ScanDiscountViewController.m 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // ScanDiscountViewController.m
  3. // HMLG Scan Order
  4. //
  5. // Created by Rui Zhang on 6/16/22.
  6. // Copyright © 2022 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "ScanDiscountViewController.h"
  9. @interface ScanDiscountViewController ()
  10. @end
  11. @implementation ScanDiscountViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. if(self.bulk)
  15. {
  16. }
  17. // Do any additional setup after loading the view.
  18. }
  19. -(void) updatebtn:(UIButton*)btn
  20. {
  21. self.btn3.backgroundColor = UIColor.clearColor;
  22. self.btn5.backgroundColor = UIColor.clearColor;
  23. self.btn8.backgroundColor = UIColor.clearColor;
  24. self.btn10.backgroundColor = UIColor.clearColor;
  25. self.btnnone.backgroundColor = UIColor.clearColor;
  26. btn.backgroundColor =UIColor.redColor;
  27. }
  28. - (IBAction)onCancel:(id)sender {
  29. [self dismissViewControllerAnimated:NO
  30. completion:^{
  31. }];
  32. }
  33. - (IBAction)onUpdate:(id)sender {
  34. [self dismissViewControllerAnimated:NO
  35. completion:^{
  36. if(self.onSetValue)
  37. self.onSetValue( self.price,self.discount);
  38. }];
  39. }
  40. - (IBAction)on3:(id)sender {
  41. self.discount = 3;
  42. [self updatebtn:sender];
  43. }
  44. - (IBAction)onnone:(id)sender {
  45. self.discount = 0;
  46. [self updatebtn:sender];
  47. }
  48. - (IBAction)on5:(id)sender {
  49. self.discount = 5;
  50. [self updatebtn:sender];
  51. }
  52. - (IBAction)on8:(id)sender {
  53. self.discount = 8;
  54. [self updatebtn:sender];
  55. }
  56. - (IBAction)on10:(id)sender {
  57. self.discount = 10;
  58. [self updatebtn:sender];
  59. }
  60. /*
  61. #pragma mark - Navigation
  62. // In a storyboard-based application, you will often want to do a little preparation before navigation
  63. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  64. // Get the new view controller using [segue destinationViewController].
  65. // Pass the selected object to the new view controller.
  66. }
  67. */
  68. @end