ThingsGeneralDelCompleteViewController.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // ThingsDelValveCompleteViewController.m
  3. // OneCable
  4. //
  5. // Created by nComz on 2017. 3. 23..
  6. // Copyright © 2017년 ntels. All rights reserved.
  7. //
  8. #import "ThingsGeneralDelCompleteViewController.h"
  9. #import "CustomLabel.h"
  10. #import "CustomButton.h"
  11. #import "CustomImageView.h"
  12. #import "ThingsGeneralDelStartViewController.h"
  13. #import "MainViewController.h"
  14. #import "ThingsViewController.h"
  15. @interface ThingsGeneralDelCompleteViewController ()
  16. @end
  17. @implementation ThingsGeneralDelCompleteViewController
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. [self initUI];
  21. [self prepareViewDidLoad];
  22. }
  23. - (void)initUI {
  24. }
  25. - (void)prepareViewDidLoad {
  26. NSMutableString *title = [NSMutableString stringWithString:_delDevice.prdName];
  27. [title appendString:@" 삭제"];
  28. _imgThings.image = [_delDevice imgaeForAddDel];
  29. _lblManufacturer.text = [_delDevice manufacturerName];
  30. _imgThingsSuccess.hidden = !_isSuccess;
  31. _imgThingsFail.hidden = _isSuccess;
  32. _btnConfirm.hidden = !_isSuccess;
  33. _viewRetry.hidden = _isSuccess;
  34. if (_isSuccess) {
  35. [title appendString:@" 성공"];
  36. } else {
  37. [title appendString:@" 실패"];
  38. }
  39. _lblTitle.text = title;
  40. }
  41. /*
  42. - (void)finishDeviceDel:(BOOL)isSuccess {
  43. [self startLoading:NO];
  44. [self requestExcludeDevice:NO];
  45. ThingsGeneralDelCompleteViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsGeneralDelCompleteViewController" storyboardName:@"Things"];
  46. vc.delDevice = _delDevice;
  47. vc.isSuccess = isSuccess;
  48. // vc.addableDevice = _addableDevice;
  49. vc.providesPresentationContextTransitionStyle = YES;
  50. vc.definesPresentationContext = YES;
  51. [vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
  52. UIViewController *pvc = self.presentingViewController;
  53. [self dismissViewControllerAnimated:NO completion:^{//TODO : UI Confirm with Mr.Mo
  54. [pvc presentViewController:vc animated:YES completion:nil];
  55. }];
  56. }
  57. */
  58. - (IBAction)btnConfirmTouched:(id)sender {
  59. [self finishDelDevice];
  60. }
  61. - (IBAction)btnCancelTouched:(id)sender {
  62. [self finishDelDevice];
  63. }
  64. - (IBAction)btnRetryTouched:(id)sender {
  65. ThingsGeneralDelStartViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsGeneralDelStartViewController" storyboardName:@"Things"];
  66. vc.delDevice = _delDevice;
  67. [self showTransparencyModalView:vc];
  68. }
  69. -(void)finishDelDevice {
  70. [self dismissViewControllerAnimated:YES completion:^{
  71. ThingsViewController *vc = [JDFacade facade].mainViewController.tvc;
  72. if (vc && [vc isKindOfClass:[ThingsViewController class]]) {
  73. [vc finishDeviveDelete];
  74. }
  75. }];
  76. }
  77. - (void)didReceiveMemoryWarning {
  78. [super didReceiveMemoryWarning];
  79. }
  80. @end