|
|
@@ -27,8 +27,8 @@
|
|
|
|
|
|
ActiveViewController* avc=(ActiveViewController*)self.active_controller;
|
|
|
|
|
|
-// NSObject* obj;
|
|
|
-// [obj isEqual:@""];
|
|
|
+ // NSObject* obj;
|
|
|
+ // [obj isEqual:@""];
|
|
|
|
|
|
[avc showHidePrice];
|
|
|
}
|
|
|
@@ -46,21 +46,21 @@
|
|
|
if(self.user==nil||self.cart_count==0)
|
|
|
{
|
|
|
main_vc.label_ccount.hidden = true;
|
|
|
-// NSString* title = [NSString stringWithFormat:@"Sign in"];
|
|
|
-// [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// main_vc.labelMode.text=nil;
|
|
|
-// [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
-// // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
-// // main_vc.buttonUser.hidden=true;
|
|
|
-// // main_vc.buttonUser.hidden=false;
|
|
|
-// // [main_vc.headerView setNeedsDisplay];
|
|
|
-// // [main_vc.headerView setNeedsLayout];
|
|
|
-// return;
|
|
|
+ // NSString* title = [NSString stringWithFormat:@"Sign in"];
|
|
|
+ // [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
+ //
|
|
|
+ // main_vc.labelMode.text=nil;
|
|
|
+ // [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
+ // // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
+ // // main_vc.buttonUser.hidden=true;
|
|
|
+ // // main_vc.buttonUser.hidden=false;
|
|
|
+ // // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // // [main_vc.headerView setNeedsLayout];
|
|
|
+ // return;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
NSString* strcount;
|
|
|
if(self.cart_count>999)
|
|
|
strcount=@"999+";
|
|
|
@@ -76,91 +76,91 @@
|
|
|
main_vc.label_ccount.frame = CGRectMake(360, 15, 31, 21);
|
|
|
if(strcount.length==4)
|
|
|
main_vc.label_ccount.frame = CGRectMake(349, 15, 42, 21);
|
|
|
- // [main_vc.label_ccount sizeToFit];
|
|
|
- // main_vc.label_ccount.center = CGPointMake(360, 15);
|
|
|
+ // [main_vc.label_ccount sizeToFit];
|
|
|
+ // main_vc.label_ccount.center = CGPointMake(360, 15);
|
|
|
|
|
|
- main_vc.label_ccount.hidden = false;
|
|
|
+ main_vc.label_ccount.hidden = false;
|
|
|
|
|
|
|
|
|
-// if(self.user_type==USER_ROLE_CUSTOMER)
|
|
|
-// {
|
|
|
-// NSString* title = [NSString stringWithFormat:@"%@",self.user];
|
|
|
-// [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
-// main_vc.labelMode.text=nil;
|
|
|
-// [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
-//
|
|
|
-// // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
-// // main_vc.buttonUser.hidden=true;
|
|
|
-// // main_vc.buttonUser.hidden=false;
|
|
|
-// // [main_vc.headerView setNeedsDisplay];
|
|
|
-// // [main_vc.headerView setNeedsLayout];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// if([mode isEqualToString:@"Regualar Mode"])
|
|
|
-// {
|
|
|
-// NSString* title = self.user;
|
|
|
-// [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// main_vc.labelMode.text=@"RM";
|
|
|
-// [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
-// // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
-// // main_vc.buttonUser.hidden=true;
|
|
|
-// // main_vc.buttonUser.hidden=false;
|
|
|
-// // [main_vc.headerView setNeedsDisplay];
|
|
|
-// // [main_vc.headerView setNeedsLayout];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// NSString* title = self.user;
|
|
|
-// [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// main_vc.labelMode.text=@"TM";
|
|
|
-// [main_vc.labelMode setTextColor:UIColorFromRGB(0x009966)];
|
|
|
-// // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x009966) forState:UIControlStateNormal];
|
|
|
-// // main_vc.buttonUser.hidden=true;
|
|
|
-// // main_vc.buttonUser.hidden=false;
|
|
|
-// // [main_vc.headerView setNeedsDisplay];
|
|
|
-// // [main_vc.headerView setNeedsLayout];
|
|
|
-// }
|
|
|
-//
|
|
|
-// NSString * contact =[self.customerInfo valueForKey:@"customer_contact"];
|
|
|
-// NSString * customer=[self.customerInfo valueForKey:@"customer_name"];
|
|
|
-// if(contact==nil||contact.length==0)
|
|
|
-// {
|
|
|
-// contact=@"No Name";
|
|
|
-// [main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-//
|
|
|
-// if(contact==nil||contact.length==0)
|
|
|
-// {
|
|
|
-// contact=@"No Name";
|
|
|
-// [main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// [main_vc.btnContact setTitleColor:UIColorFromRGB(0x009900) forState:UIControlStateNormal];
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// NSMutableArray* arr_contact = [[NSMutableArray alloc] init];
|
|
|
-// if(contact.length>0)
|
|
|
-// [arr_contact addObject:contact];
|
|
|
-// if(customer.length>0)
|
|
|
-// [arr_contact addObject:customer];
|
|
|
-//
|
|
|
-// NSString *contact_string = [arr_contact componentsJoinedByString:@" @"];
|
|
|
-//
|
|
|
-//
|
|
|
-// [main_vc.btnContact setTitle:contact_string forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// }
|
|
|
+ // if(self.user_type==USER_ROLE_CUSTOMER)
|
|
|
+ // {
|
|
|
+ // NSString* title = [NSString stringWithFormat:@"%@",self.user];
|
|
|
+ // [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
+ // main_vc.labelMode.text=nil;
|
|
|
+ // [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
+ //
|
|
|
+ // // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
+ // // main_vc.buttonUser.hidden=true;
|
|
|
+ // // main_vc.buttonUser.hidden=false;
|
|
|
+ // // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // // [main_vc.headerView setNeedsLayout];
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // if([mode isEqualToString:@"Regualar Mode"])
|
|
|
+ // {
|
|
|
+ // NSString* title = self.user;
|
|
|
+ // [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
+ //
|
|
|
+ // main_vc.labelMode.text=@"RM";
|
|
|
+ // [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
+ // // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
+ // // main_vc.buttonUser.hidden=true;
|
|
|
+ // // main_vc.buttonUser.hidden=false;
|
|
|
+ // // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // // [main_vc.headerView setNeedsLayout];
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // NSString* title = self.user;
|
|
|
+ // [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
+ //
|
|
|
+ // main_vc.labelMode.text=@"TM";
|
|
|
+ // [main_vc.labelMode setTextColor:UIColorFromRGB(0x009966)];
|
|
|
+ // // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x009966) forState:UIControlStateNormal];
|
|
|
+ // // main_vc.buttonUser.hidden=true;
|
|
|
+ // // main_vc.buttonUser.hidden=false;
|
|
|
+ // // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // // [main_vc.headerView setNeedsLayout];
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // NSString * contact =[self.customerInfo valueForKey:@"customer_contact"];
|
|
|
+ // NSString * customer=[self.customerInfo valueForKey:@"customer_name"];
|
|
|
+ // if(contact==nil||contact.length==0)
|
|
|
+ // {
|
|
|
+ // contact=@"No Name";
|
|
|
+ // [main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ //
|
|
|
+ // if(contact==nil||contact.length==0)
|
|
|
+ // {
|
|
|
+ // contact=@"No Name";
|
|
|
+ // [main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // [main_vc.btnContact setTitleColor:UIColorFromRGB(0x009900) forState:UIControlStateNormal];
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // NSMutableArray* arr_contact = [[NSMutableArray alloc] init];
|
|
|
+ // if(contact.length>0)
|
|
|
+ // [arr_contact addObject:contact];
|
|
|
+ // if(customer.length>0)
|
|
|
+ // [arr_contact addObject:customer];
|
|
|
+ //
|
|
|
+ // NSString *contact_string = [arr_contact componentsJoinedByString:@" @"];
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // [main_vc.btnContact setTitle:contact_string forState:UIControlStateNormal];
|
|
|
+ //
|
|
|
+ // }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-(void) closeOrder
|
|
|
{
|
|
|
@@ -169,12 +169,12 @@
|
|
|
self.customerInfo = nil;
|
|
|
self.contact_id = nil;
|
|
|
[self SetMode:nil];
|
|
|
- // [self SetSo:nil];
|
|
|
+ // [self SetSo:nil];
|
|
|
+
|
|
|
|
|
|
|
|
|
-
|
|
|
[((MainViewController*)self.main_vc) reloadCart:true immediately:false];
|
|
|
- [((MainViewController*)self.main_vc) reloadOrder:true immediately:false];
|
|
|
+ [((MainViewController*)self.main_vc) reloadOrder:true immediately:false];
|
|
|
}
|
|
|
-(void) switchToPreviousVC
|
|
|
{
|
|
|
@@ -187,107 +187,107 @@
|
|
|
{
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- if(self.main_vc==nil)
|
|
|
- return;
|
|
|
-
|
|
|
- MainViewController * main_vc= (MainViewController*)self.main_vc;
|
|
|
-
|
|
|
- if(self.user==nil)
|
|
|
- {
|
|
|
+ if(self.main_vc==nil)
|
|
|
+ return;
|
|
|
|
|
|
- NSString* title = [NSString stringWithFormat:@"Sign in"];
|
|
|
- [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
-
|
|
|
- main_vc.labelMode.text=nil;
|
|
|
- [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
-// [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
-// main_vc.buttonUser.hidden=true;
|
|
|
-// main_vc.buttonUser.hidden=false;
|
|
|
-// [main_vc.headerView setNeedsDisplay];
|
|
|
-// [main_vc.headerView setNeedsLayout];
|
|
|
- return;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if(self.user_type==USER_ROLE_CUSTOMER)
|
|
|
+ MainViewController * main_vc= (MainViewController*)self.main_vc;
|
|
|
+
|
|
|
+ if(self.user==nil)
|
|
|
{
|
|
|
- NSString* title = [NSString stringWithFormat:@"%@",self.user];
|
|
|
+
|
|
|
+ NSString* title = [NSString stringWithFormat:@"Sign in"];
|
|
|
[main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
+
|
|
|
main_vc.labelMode.text=nil;
|
|
|
[main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
-
|
|
|
-// [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
-// main_vc.buttonUser.hidden=true;
|
|
|
-// main_vc.buttonUser.hidden=false;
|
|
|
-// [main_vc.headerView setNeedsDisplay];
|
|
|
-// [main_vc.headerView setNeedsLayout];
|
|
|
+ // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
+ // main_vc.buttonUser.hidden=true;
|
|
|
+ // main_vc.buttonUser.hidden=false;
|
|
|
+ // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // [main_vc.headerView setNeedsLayout];
|
|
|
+ return;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if([mode isEqualToString:@"Regualar Mode"])
|
|
|
+ if(self.user_type==USER_ROLE_CUSTOMER)
|
|
|
{
|
|
|
- NSString* title = self.user;
|
|
|
+ NSString* title = [NSString stringWithFormat:@"%@",self.user];
|
|
|
[main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
-
|
|
|
- main_vc.labelMode.text=@"RM";
|
|
|
+ main_vc.labelMode.text=nil;
|
|
|
[main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
-// [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
-// main_vc.buttonUser.hidden=true;
|
|
|
-// main_vc.buttonUser.hidden=false;
|
|
|
-// [main_vc.headerView setNeedsDisplay];
|
|
|
-// [main_vc.headerView setNeedsLayout];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- NSString* title = self.user;
|
|
|
- [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
|
|
|
- main_vc.labelMode.text=@"TM";
|
|
|
- [main_vc.labelMode setTextColor:UIColorFromRGB(0x009966)];
|
|
|
-// [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x009966) forState:UIControlStateNormal];
|
|
|
-// main_vc.buttonUser.hidden=true;
|
|
|
-// main_vc.buttonUser.hidden=false;
|
|
|
-// [main_vc.headerView setNeedsDisplay];
|
|
|
-// [main_vc.headerView setNeedsLayout];
|
|
|
- }
|
|
|
-
|
|
|
- NSString * contact =[self.customerInfo valueForKey:@"customer_contact"];
|
|
|
- NSString * customer=[self.customerInfo valueForKey:@"customer_name"];
|
|
|
- if(self.customerInfo==nil)
|
|
|
- {
|
|
|
-// contact=@"No Name"; if(customerinfo==nil)
|
|
|
-// {
|
|
|
- contact=@"Select Contact";
|
|
|
- [main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
|
|
+ // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
+ // main_vc.buttonUser.hidden=true;
|
|
|
+ // main_vc.buttonUser.hidden=false;
|
|
|
+ // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // [main_vc.headerView setNeedsLayout];
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ if([mode isEqualToString:@"Regualar Mode"])
|
|
|
+ {
|
|
|
+ NSString* title = self.user;
|
|
|
+ [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
+
|
|
|
+ main_vc.labelMode.text=@"RM";
|
|
|
+ [main_vc.labelMode setTextColor:UIColorFromRGB(0x336699)];
|
|
|
+ // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x996633) forState:UIControlStateNormal];
|
|
|
+ // main_vc.buttonUser.hidden=true;
|
|
|
+ // main_vc.buttonUser.hidden=false;
|
|
|
+ // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // [main_vc.headerView setNeedsLayout];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ NSString* title = self.user;
|
|
|
+ [main_vc.buttonUser setTitle:title forState:UIControlStateNormal];
|
|
|
+
|
|
|
+ main_vc.labelMode.text=@"TM";
|
|
|
+ [main_vc.labelMode setTextColor:UIColorFromRGB(0x009966)];
|
|
|
+ // [main_vc.buttonUser setTitleColor:UIColorFromRGB(0x009966) forState:UIControlStateNormal];
|
|
|
+ // main_vc.buttonUser.hidden=true;
|
|
|
+ // main_vc.buttonUser.hidden=false;
|
|
|
+ // [main_vc.headerView setNeedsDisplay];
|
|
|
+ // [main_vc.headerView setNeedsLayout];
|
|
|
+ }
|
|
|
|
|
|
- if(contact==nil||contact.length==0)
|
|
|
+ NSString * contact =[self.customerInfo valueForKey:@"customer_contact"];
|
|
|
+ NSString * customer=[self.customerInfo valueForKey:@"customer_name"];
|
|
|
+ if(self.customerInfo==nil)
|
|
|
{
|
|
|
- contact=@"No Name";
|
|
|
+ // contact=@"No Name"; if(customerinfo==nil)
|
|
|
+ // {
|
|
|
+ contact=@"Select Contact";
|
|
|
[main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- [main_vc.btnContact setTitleColor:UIColorFromRGB(0x009900) forState:UIControlStateNormal];
|
|
|
+
|
|
|
+ if(contact==nil||contact.length==0)
|
|
|
+ {
|
|
|
+ contact=@"No Name";
|
|
|
+ [main_vc.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ [main_vc.btnContact setTitleColor:UIColorFromRGB(0x009900) forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ NSMutableArray* arr_contact = [[NSMutableArray alloc] init];
|
|
|
+ if(contact.length>0)
|
|
|
+ [arr_contact addObject:contact];
|
|
|
+ if(customer.length>0)
|
|
|
+ [arr_contact addObject:customer];
|
|
|
+
|
|
|
+ NSString *contact_string = [arr_contact componentsJoinedByString:@" @"];
|
|
|
+
|
|
|
+
|
|
|
+ [main_vc.btnContact setTitle:contact_string forState:UIControlStateNormal];
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- NSMutableArray* arr_contact = [[NSMutableArray alloc] init];
|
|
|
- if(contact.length>0)
|
|
|
- [arr_contact addObject:contact];
|
|
|
- if(customer.length>0)
|
|
|
- [arr_contact addObject:customer];
|
|
|
-
|
|
|
- NSString *contact_string = [arr_contact componentsJoinedByString:@" @"];
|
|
|
-
|
|
|
-
|
|
|
- [main_vc.btnContact setTitle:contact_string forState:UIControlStateNormal];
|
|
|
-
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -303,9 +303,9 @@
|
|
|
if(self.user==nil)
|
|
|
{
|
|
|
|
|
|
-// NSString* title = [NSString stringWithFormat:@"Sign in"];
|
|
|
+ // NSString* title = [NSString stringWithFormat:@"Sign in"];
|
|
|
main_vc.labelSo.text=nil;
|
|
|
-
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
else
|
|
|
@@ -326,8 +326,8 @@
|
|
|
main_vc.labelSo.text=nil;
|
|
|
else
|
|
|
{
|
|
|
- NSString* text =[NSString stringWithFormat:@"SO#: %@",So];
|
|
|
- main_vc.labelSo.text=text;
|
|
|
+ NSString* text =[NSString stringWithFormat:@"SO#: %@",So];
|
|
|
+ main_vc.labelSo.text=text;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -355,7 +355,7 @@
|
|
|
// UIViewController *currentViewController = [self topViewController];
|
|
|
//
|
|
|
// if ([currentViewController respondsToSelector:@selector(lockPortrait)]) {
|
|
|
-//
|
|
|
+//
|
|
|
// return UIInterfaceOrientationMaskPortrait;
|
|
|
// }
|
|
|
////
|
|
|
@@ -366,6 +366,39 @@
|
|
|
{
|
|
|
// Override point for customization after application launch.
|
|
|
|
|
|
+ NSString* order_filter_source_path =[[NSBundle mainBundle] pathForResource:@"status_filter_cadedate" ofType:@"json" ];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
|
+ NSString *documents = [paths objectAtIndex:0];
|
|
|
+ NSString *dist_path = [documents stringByAppendingPathComponent:@"status_filter_cadedate.json"];
|
|
|
+
|
|
|
+
|
|
|
+ if ([[NSFileManager defaultManager] fileExistsAtPath:dist_path]) {
|
|
|
+
|
|
|
+ NSLog(@"文件已经存在了");
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // NSLog(@"resourceSampleImagesFolderPath=%@",resourceFolderPath);
|
|
|
+
|
|
|
+ NSData *mainBundleFile = [NSData dataWithContentsOfFile:order_filter_source_path];
|
|
|
+
|
|
|
+ // NSLog(@"mainBundleFile==%@",mainBundleFile);
|
|
|
+
|
|
|
+ [[NSFileManager defaultManager] createFileAtPath:dist_path
|
|
|
+
|
|
|
+ contents:mainBundleFile
|
|
|
+
|
|
|
+ attributes:nil];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if (! [iSalesDB initializeDb])
|
|
|
// TODO: alert the user!
|
|
|
DebugLog(@"couldn't init db");
|
|
|
@@ -403,10 +436,10 @@
|
|
|
[ScanApi setDelegate:self];
|
|
|
self.enable_ScannerLog = true;
|
|
|
self.api_Status= API_STOP;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
//UILabel * appearanceLabel = [UILabel appearanceWhenContainedIn:uialertcontroller.class, nil];
|
|
|
// [appearanceLabel setAppearanceFont:[UIFont boldSystemFontOfSize:10]]; //for example
|
|
|
@@ -530,7 +563,7 @@
|
|
|
[avc onStatusChanged:@"Stoping..."];
|
|
|
[ScanApi close];
|
|
|
|
|
|
-
|
|
|
+
|
|
|
[self addlog:@"ScanApi close"];
|
|
|
|
|
|
|
|
|
@@ -560,7 +593,7 @@
|
|
|
[temp appendString:@"Waiting for Scanner..."];
|
|
|
|
|
|
|
|
|
- // _Status.text=temp ;
|
|
|
+ // _Status.text=temp ;
|
|
|
[self addlog:temp];
|
|
|
ActiveViewController* avc=(ActiveViewController*)self.active_controller;
|
|
|
self.Status_Text = temp;
|
|
|
@@ -568,7 +601,7 @@
|
|
|
[avc OnUpdateDevicesList];
|
|
|
|
|
|
// if ([self.active_controller respondsToSelector:@selector(lockPortrait)])
|
|
|
- // [self.dev_table reloadData];
|
|
|
+ // [self.dev_table reloadData];
|
|
|
|
|
|
}
|
|
|
#pragma mark - ScanApiHelper complete delegates
|
|
|
@@ -836,7 +869,7 @@
|
|
|
ActiveViewController* avc=(ActiveViewController*)self.active_controller;
|
|
|
[avc onErrorInfo:[NSString stringWithFormat:@"ScanAPI is reporting an error: %ld",result]];
|
|
|
|
|
|
- // _Status.text=[NSString stringWithFormat:@"ScanAPI is reporting an error: %ld",result];
|
|
|
+ // _Status.text=[NSString stringWithFormat:@"ScanAPI is reporting an error: %ld",result];
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -875,9 +908,9 @@
|
|
|
[avc onDecodedData:value];
|
|
|
//_Entry.text=[NSString stringWithUTF8String:(const char *)[decodedData getData]];
|
|
|
[self addlog:value];
|
|
|
-// if(_doAppDataConfirmation==YES){
|
|
|
-// [ScanApi postSetDataConfirmation:device Target:self Response:@selector(onDataConfirmation:)];
|
|
|
-// }
|
|
|
+ // if(_doAppDataConfirmation==YES){
|
|
|
+ // [ScanApi postSetDataConfirmation:device Target:self Response:@selector(onDataConfirmation:)];
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
-(void) didRotated
|
|
|
@@ -897,7 +930,7 @@
|
|
|
if(SKTSUCCESS(result))
|
|
|
{
|
|
|
self.api_Status = API_START;
|
|
|
-
|
|
|
+
|
|
|
NSString* strlog =[NSString stringWithFormat:@"onScanApiInitialize SUCCESS result:%ld",result];
|
|
|
[self addlog:strlog];
|
|
|
|
|
|
@@ -924,13 +957,13 @@
|
|
|
ActiveViewController* avc=(ActiveViewController*)self.active_controller;
|
|
|
[avc onStatusChanged:@"Waiting for scanner..."];
|
|
|
self.Status_Text = @"Waiting for scanner...";
|
|
|
- // _Status.text=@"Waiting for scanner...";
|
|
|
+ // _Status.text=@"Waiting for scanner...";
|
|
|
}
|
|
|
else{
|
|
|
ActiveViewController* avc=(ActiveViewController*)self.active_controller;
|
|
|
[avc onStatusChanged:[NSString stringWithFormat:@"Error initializing ScanAPI:%ld",result]];
|
|
|
self.Status_Text =[NSString stringWithFormat:@"Error initializing ScanAPI:%ld",result];
|
|
|
- // _Status.text=[NSString stringWithFormat:@"Error initializing ScanAPI:%ld",result];
|
|
|
+ // _Status.text=[NSString stringWithFormat:@"Error initializing ScanAPI:%ld",result];
|
|
|
NSString* strlog =[NSString stringWithFormat:@"Error initializing ScanAPI:%ld",result];
|
|
|
[self addlog:strlog];
|
|
|
}
|
|
|
@@ -950,11 +983,11 @@
|
|
|
[self addlog:@"ScanApiConsumer invalidate"];
|
|
|
|
|
|
self.api_Status = API_STOP;
|
|
|
-
|
|
|
+
|
|
|
ActiveViewController* avc=(ActiveViewController*)self.active_controller;
|
|
|
[avc onStatusChanged:@"Off"];
|
|
|
self.Status_Text =@"Off";
|
|
|
- // _Status.text = @"Off";
|
|
|
+ // _Status.text = @"Off";
|
|
|
|
|
|
}
|
|
|
|