| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- //
- // ScanHistoryViewController.m
- // HMLG Scan Order
- //
- // Created by Rui Zhang on 3/29/22.
- // Copyright © 2022 United Software Applications, Inc. All rights reserved.
- //
- #import "ScanHistoryViewController.h"
- #import "ScanListCell.h"
- #import "RASingleton.h"
- #import "RADataProvider.h"
- @interface ScanHistoryViewController ()
- @end
- @implementation ScanHistoryViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
- // [self refreshStock];
- }
- - (IBAction)onUpdateStock:(id)sender {
- [RADataProvider updateStock:self];
- }
- - (void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- self.labelStock.text = [RADataProvider queryStockUpdateTime];
- }
- -(void) refreshStock
- {
-
-
- // NSDictionary *addressDic1 = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanStock"];
- // if (addressDic1) {
- // NSString* updatetime=addressDic1[@"updatetime"];
- // self.labelStock.text = updatetime;
- // }
- //
- self.labelStock.text = [RADataProvider queryStockUpdateTime];
- [self.tableview reloadData];
- }
- /*
- #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.
- }
- */
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-
- return RASingleton.sharedInstance.scan_list.count;
-
-
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- return 166.0f;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- ScanListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ScanListCell"];
- if (!cell) {
- cell = [[ScanListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ScanListCell"];
- }
- NSMutableArray* arr = RASingleton.sharedInstance.scan_list;
-
- [cell setModelJson:arr[indexPath.row]];
-
- cell.labelStock.text = [RADataProvider queryStock:cell.labelModel.text];
- return cell;
- }
- //#pragma mark - TableView Delegate
- /*
- #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.
- }
- */
- //- (IBAction)onAddToCart:(id)sender {
- //
- // [self dismissViewControllerAnimated:true completion:^{
- // if(self.returnValue)
- // self.returnValue(self.modellist);
- // }];
- //
- //
- //}
- #pragma mark - RA_NOTIFICAITON
- -(void) refresh_ui
- {
- [self.tableview reloadData];
- }
- -(void) reload_data {
- [self.tableview reloadData];
- }
- @end
|