//
//  InformationPopupViewController.m
//  SKCore
//
//  Created by jungeol.park on 2014. 10. 1..
//  Copyright (c) 2014 ACCVUER. All rights reserved.
//

#import "TransferWaitingQueuePopupViewController.h"

@interface TransferWaitingQueuePopupViewController ()

@end

@implementation TransferWaitingQueuePopupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.positionNumberLabel.text = [NSString stringWithFormat:@"%d", (int)self.position];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void)updatePositionLabel:(NSInteger)a_position
{
    self.position = a_position;
    self.positionNumberLabel.text = [NSString stringWithFormat:@"%d", (int)self.position];
}

- (IBAction)cancelButtonClicked:(id)sender
{
    
    UIAlertView *alert = [[UIAlertView alloc]
                      initWithTitle:NSLocalizedString(@"information", nil)
                      message:NSLocalizedString(@"CancelTransferWaitingQueuePopup_message", nil)
                      delegate:self
                      cancelButtonTitle:NSLocalizedString(@"MenuAlert_Cancel",nil)
                      otherButtonTitles:NSLocalizedString(@"MenuAlert_OK",nil),nil];
    alert.delegate = self;
    [alert show];
}

-(void) alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
    if (buttonIndex != alertView.cancelButtonIndex)
    {
        if ([self.delegate respondsToSelector:@selector(cancelTransferWaitingQueuRequest)])
            [self.delegate cancelTransferWaitingQueuRequest];
    }
}

-(void)dismissSelfPopup
{
    if ([self.delegate respondsToSelector:@selector(dismissTransferWaitingQueuePopupView)])
        [self.delegate dismissTransferWaitingQueuePopupView];
}
@end
