ThingsGeneralDelCompleteViewController.m 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. #import "ThingsDetailViewController.h"
  16. @interface ThingsGeneralDelCompleteViewController ()
  17. @end
  18. @implementation ThingsGeneralDelCompleteViewController
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. [self initUI];
  22. [self prepareViewDidLoad];
  23. }
  24. - (void)initUI {
  25. }
  26. - (void)prepareViewDidLoad {
  27. NSMutableString *title = [NSMutableString stringWithString:_delDevice.prdName];
  28. [title appendString:@" 삭제"];
  29. _imgThings.image = [_delDevice imgaeForAddDel];
  30. _lblManufacturer.text = [_delDevice manufacturerName];
  31. _imgThingsSuccess.hidden = !_isSuccess;
  32. _imgThingsFail.hidden = _isSuccess;
  33. _btnConfirm.hidden = !_isSuccess;
  34. _viewRetry.hidden = _isSuccess;
  35. if (_isSuccess) {
  36. [title appendString:@" 성공"];
  37. } else {
  38. [title appendString:@" 실패"];
  39. }
  40. _lblTitle.text = title;
  41. }
  42. /*
  43. - (void)finishDeviceDel:(BOOL)isSuccess {
  44. [self startLoading:NO];
  45. [self requestExcludeDevice:NO];
  46. ThingsGeneralDelCompleteViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsGeneralDelCompleteViewController" storyboardName:@"Things"];
  47. vc.delDevice = _delDevice;
  48. vc.isSuccess = isSuccess;
  49. // vc.addableDevice = _addableDevice;
  50. vc.providesPresentationContextTransitionStyle = YES;
  51. vc.definesPresentationContext = YES;
  52. [vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
  53. UIViewController *pvc = self.presentingViewController;
  54. [self dismissViewControllerAnimated:NO completion:^{//TODO : UI Confirm with Mr.Mo
  55. [pvc presentViewController:vc animated:YES completion:nil];
  56. }];
  57. }
  58. */
  59. - (IBAction)btnConfirmTouched:(id)sender {
  60. [self finishDelDevice];
  61. }
  62. - (IBAction)btnCancelTouched:(id)sender {
  63. [self finishDelDevice];
  64. }
  65. - (IBAction)btnRetryTouched:(id)sender {
  66. ThingsGeneralDelStartViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsGeneralDelStartViewController" storyboardName:@"Things"];
  67. vc.delDevice = _delDevice;
  68. [self showTransparencyModalView:vc];
  69. }
  70. -(void)finishDelDevice {
  71. [self dismissViewControllerAnimated:YES completion:^{
  72. ThingsViewController *vc = [JDFacade facade].mainViewController.tvc;
  73. if (vc && [vc isKindOfClass:[ThingsViewController class]]) {
  74. [vc finishDeviveDelete];
  75. } else {
  76. ThingsDetailViewController *vc2 = (ThingsDetailViewController *)vc;
  77. [vc2 finishDeviveDelete];
  78. }
  79. }];
  80. }
  81. - (void)didReceiveMemoryWarning {
  82. [super didReceiveMemoryWarning];
  83. }
  84. @end