| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- //
- // RetrievePassViewController.m
- // RedAnt ERP Mobile
- //
- // Created by Ray on 9/10/15.
- // Copyright (c) 2015 United Software Applications, Inc. All rights reserved.
- //
- #import "RetrievePassViewController.h"
- #import "RANetwork.h"
- @interface RetrievePassViewController ()
- @end
- @implementation RetrievePassViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
-
-
- // Dispose of any resources that can be recreated.
- }
- - (IBAction)onRetrieveClicked:(id)sender {
- NSString* user = self.editUser.text;
- NSString* email = self.editEmail.text;
-
- if(user.length==0||email.length==0)
- {
- // UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Error!" message:@"user or email can not be empty." delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
- // // UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
- //
- //
- // //[[UILabel appearanceWhenContainedIn:UIAlertView.class, nil] setAppearanceFont:[UIFont boldSystemFontOfSize:10]];
- // [alert show];
-
-
- [RAUtils alert_view:@"User or email cannot be empty." title:@"Input Error!"];
- return;
- }
-
-
-
- self.buttonRetrieve.enabled = false;
-
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-
-
- NSDictionary* json=[RANetwork retrieve_password:user email:email];
-
- dispatch_async(dispatch_get_main_queue(), ^{
-
- self.buttonRetrieve.enabled = true;
-
- if([[json valueForKey:@"result"] intValue]==2)
- {
-
- UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Successful!" message:@"Please Check email later." delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
- [alert show];
-
- }
- else
- {
- [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Retrieve Password" controller:self] ;
- }
-
- });
- });
-
- }
- /*
- #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.
- }
- */
- @end
|