RetrievePassViewController.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //
  2. // RetrievePassViewController.m
  3. // RedAnt ERP Mobile
  4. //
  5. // Created by Ray on 9/10/15.
  6. // Copyright (c) 2015 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "RetrievePassViewController.h"
  9. #import "RANetwork.h"
  10. @interface RetrievePassViewController ()
  11. @end
  12. @implementation RetrievePassViewController
  13. - (void)viewDidLoad {
  14. [super viewDidLoad];
  15. // Do any additional setup after loading the view.
  16. }
  17. - (void)didReceiveMemoryWarning {
  18. [super didReceiveMemoryWarning];
  19. // Dispose of any resources that can be recreated.
  20. }
  21. - (IBAction)onRetrieveClicked:(id)sender {
  22. NSString* user = self.editUser.text;
  23. NSString* email = self.editEmail.text;
  24. if(user.length==0||email.length==0)
  25. {
  26. [RAUtils message_box:@"Input Error!" message:@"User or email cannot be empty." completion:nil];
  27. return;
  28. }
  29. self.buttonRetrieve.enabled = false;
  30. [RANetwork request_retrieve_password:user email:email completionHandler:^(NSMutableDictionary *result) {
  31. NSDictionary* json=result;
  32. self.buttonRetrieve.enabled = true;
  33. if([[json valueForKey:@"result"] intValue]==2)
  34. {
  35. [RAUtils message_box:@"Successful!" message:@"Please Check email later." completion:nil];
  36. }
  37. else
  38. {
  39. [RAUtils message_box:@"Retrieve Password" message:[json valueForKey:@"err_msg"] completion:nil];
  40. }
  41. }];
  42. }
  43. /*
  44. #pragma mark - Navigation
  45. // In a storyboard-based application, you will often want to do a little preparation before navigation
  46. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  47. // Get the new view controller using [segue destinationViewController].
  48. // Pass the selected object to the new view controller.
  49. }
  50. */
  51. @end