|
|
@@ -98,68 +98,6 @@
|
|
|
}
|
|
|
- (IBAction)create_HangTag:(id)sender {
|
|
|
|
|
|
-// DetailViewController *vc= (DetailViewController *)[RAUtils getViewController:self];
|
|
|
-//
|
|
|
-// NSString *catelog_name = [NSString stringWithFormat:@"%@ Hang Tag",vc.groupName];
|
|
|
-//
|
|
|
-// UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Processing"];
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* editor_json = [RANetwork request_hangTag:vc.groupName];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
-//
|
|
|
-//
|
|
|
-// if([[editor_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-// AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
-//
|
|
|
-// NSString* url = [editor_json valueForKey:@"pdf_path"];
|
|
|
-// bool isLocalFile = [[editor_json valueForKey:@"isLocalFile"] boolValue];
|
|
|
-// RAPDFViewController *ViewController = [[UIStoryboard storyboardWithName:@"wkweb" bundle:nil] instantiateViewControllerWithIdentifier:@"RAPDFViewController"];
|
|
|
-// ViewController.url = url;
|
|
|
-// ViewController.canSave = false;
|
|
|
-// ViewController.isLocalfile=isLocalFile;
|
|
|
-//
|
|
|
-// ViewController.filename = [NSString stringWithFormat:@"%@.pdf",[TextUtils legalFilename:catelog_name]];
|
|
|
-//
|
|
|
-//
|
|
|
-// NSString* company= [appDelegate.customerInfo valueForKey:@"customer_name"];
|
|
|
-//
|
|
|
-// if(company==nil)
|
|
|
-// company=@"";
|
|
|
-//
|
|
|
-// NSString* customer_email= [appDelegate.customerInfo valueForKey:@"customer_email"];
|
|
|
-//
|
|
|
-//
|
|
|
-// NSMutableArray* send_to = [[NSMutableArray alloc]init];
|
|
|
-// if(customer_email.length>0)
|
|
|
-// {
|
|
|
-// send_to=[[customer_email componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy];
|
|
|
-// }
|
|
|
-// ViewController.mail_to = send_to;
|
|
|
-//
|
|
|
-// NSString* subject;
|
|
|
-//
|
|
|
-// subject =catelog_name;
|
|
|
-//
|
|
|
-// ViewController.mail_subject = subject;
|
|
|
-//
|
|
|
-// ViewController.hidenavi = false;
|
|
|
-// [vc.navigationController pushViewController:ViewController animated:YES];
|
|
|
-//
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Create Hang Tag" controller:vc];
|
|
|
-// }
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
-//
|
|
|
-//
|
|
|
}
|
|
|
- (IBAction)add_toPortfolio:(id)sender {
|
|
|
|
|
|
@@ -229,7 +167,8 @@
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add to portfolio" controller:vc] ;
|
|
|
+ [RAUtils message_box:@"Add to portfolio" message:[return_json valueForKey:@"err_msg"] completion:nil] ;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -237,46 +176,7 @@
|
|
|
|
|
|
}];
|
|
|
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toPortfolio:self.product_id withScreen:ScreenCodeModelInfo];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-// // DebugLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
|
|
-//
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
|
|
|
-//#endif
|
|
|
-//
|
|
|
-// if(self.WatchlistBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddPortfolio.center.x-50, self.btnaddPortfolio.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.PortfolioBlock(iv);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add to portfolio" controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|
|
|
@@ -336,49 +236,12 @@
|
|
|
else
|
|
|
{
|
|
|
UIViewController *vc= [RAUtils getViewController:self];
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add to portfolio" controller:vc] ;
|
|
|
+ [RAUtils message_box:@"Add to portfolio" message:[return_json valueForKey:@"err_msg"] completion:nil] ;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toPortfolio:self.product_id withScreen:ScreenCodeModelInfo];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
|
|
|
-//#endif
|
|
|
-// if(self.WatchlistBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddPortfolio.center.x-50, self.btnaddPortfolio.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.PortfolioBlock(iv);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add to portfolio" controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -441,54 +304,14 @@
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add Wish List" controller:vc] ;
|
|
|
+ [RAUtils message_box:@"Add Wish List" message:[return_json valueForKey:@"err_msg"] completion:nil] ;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
-
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toWatchList:self.product_id withScreen:ScreenCodeModelInfo];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-// // DebugLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
|
|
-//
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
|
|
|
-//#endif
|
|
|
-//
|
|
|
-// if(self.WatchlistBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddWish.center.x-50, self.btnaddWish.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.WatchlistBlock(iv);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add Wish List" controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -549,51 +372,13 @@
|
|
|
else
|
|
|
{
|
|
|
UIViewController *vc= [RAUtils getViewController:self];
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add Wish List" controller:vc] ;
|
|
|
+ [RAUtils message_box:@"Add Wish List" message:[return_json valueForKey:@"err_msg"] completion:nil] ;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toWatchList:self.product_id withScreen:ScreenCodeModelInfo];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
|
|
|
-//#endif
|
|
|
-//
|
|
|
-// if(self.WatchlistBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddWish.center.x-50, self.btnaddWish.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.WatchlistBlock(iv);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add Wish List" controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -795,7 +580,9 @@
|
|
|
|
|
|
if (count % self.step != 0) {
|
|
|
UIViewController *vc= [RAUtils getViewController:self];
|
|
|
- [RAUtils message_alert:[NSString stringWithFormat:@"Sold in quantities of %d",(int)(self.stepper.stepValue)] title:@"Add to cart" controller:vc];
|
|
|
+
|
|
|
+
|
|
|
+ [RAUtils message_box:@"Add to cart" message:[NSString stringWithFormat:@"Sold in quantities of %d",(int)(self.stepper.stepValue)] completion:nil];
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -953,7 +740,8 @@
|
|
|
self.btnaddCart.enabled = NO;
|
|
|
}
|
|
|
|
|
|
- [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
+ [RAUtils message_box:title message:msg completion:nil] ;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -961,70 +749,7 @@
|
|
|
|
|
|
}];
|
|
|
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toCart:self.product_id count:count name:self.model_label.text];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-// // NSString* order_code = [return_json valueForKey:@"order_code"];
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
-//#endif
|
|
|
-// if(self.shopCartBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.shopCartBlock(iv);
|
|
|
-//
|
|
|
-// self.cqty +=count;
|
|
|
-// if(self.set_cqty)
|
|
|
-// self.set_cqty(self.cqty);
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// NSString *msg = [return_json valueForKey:@"err_msg"];
|
|
|
-// NSString *title = @"Add To Cart";
|
|
|
-// if ([msg hasPrefix:@"Out of Stock.\n"]) {
|
|
|
-// title = @"Add To Cart: Out of Stock";
|
|
|
-// msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
|
|
|
-// self.btnNotifyMe.enabled = YES;
|
|
|
-// self.btnaddCart.enabled = NO;
|
|
|
-// }
|
|
|
-//
|
|
|
-// [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
}];
|
|
|
|
|
|
UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
|
|
@@ -1093,130 +818,18 @@
|
|
|
self.btnaddCart.enabled = NO;
|
|
|
}
|
|
|
|
|
|
- [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
+ [RAUtils message_box:title message:msg completion:nil] ;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toCart:self.product_id count:count name:self.model_label.text];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-// // NSString* order_code = [return_json valueForKey:@"order_code"];
|
|
|
-//
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
-//#endif
|
|
|
-// if(self.shopCartBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.shopCartBlock(iv);
|
|
|
-//
|
|
|
-// self.cqty +=count;
|
|
|
-// if(self.set_cqty)
|
|
|
-// self.set_cqty(self.cqty);
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// NSString *msg = [return_json valueForKey:@"err_msg"];
|
|
|
-// NSString *title = @"Add To Cart";
|
|
|
-// if ([msg hasPrefix:@"Out of Stock.\n"]) {
|
|
|
-// title = @"Add To Cart: Out of Stock";
|
|
|
-// msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
|
|
|
-// self.btnNotifyMe.enabled = YES;
|
|
|
-// self.btnaddCart.enabled = NO;
|
|
|
-// }
|
|
|
-//
|
|
|
-// [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [iSalesNetwork add_toCart:self.product_id count:count];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-// // NSString* order_code = [return_json valueForKey:@"order_code"];
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
-//// appDelegate.order_code = order_code;
|
|
|
-////
|
|
|
-//// AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
-//// appDelegate.order_code = order_code;
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
-//
|
|
|
-//
|
|
|
-// if(self.shopCartBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.shopCartBlock(iv);
|
|
|
-//
|
|
|
-// self.cqty +=count;
|
|
|
-// if(self.set_cqty)
|
|
|
-// self.set_cqty(self.cqty);
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
-//
|
|
|
-
|
|
|
+
|
|
|
}];
|
|
|
|
|
|
UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
|
|
@@ -1307,79 +920,14 @@
|
|
|
self.btnaddCart.enabled = NO;
|
|
|
}
|
|
|
|
|
|
- [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
+ [RAUtils message_box:title message:msg completion:nil] ;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
-
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toCart:self.product_id count:count name:self.model_label.text];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// // NSString* order_code = [return_json valueForKey:@"order_code"];
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
-// // appDelegate.order_code = order_code;
|
|
|
-// //
|
|
|
-// // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
-// // appDelegate.order_code = order_code;
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
-//#endif
|
|
|
-// if(self.shopCartBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.shopCartBlock(iv);
|
|
|
-//
|
|
|
-// self.cqty +=count;
|
|
|
-// if(self.set_cqty)
|
|
|
-// self.set_cqty(self.cqty);
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// NSString *msg = [return_json valueForKey:@"err_msg"];
|
|
|
-// NSString *title = @"Add To Cart";
|
|
|
-// if ([msg hasPrefix:@"Out of Stock.\n"]) {
|
|
|
-// title = @"Add To Cart: Out of Stock";
|
|
|
-// msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
|
|
|
-// self.btnNotifyMe.enabled = YES;
|
|
|
-// self.btnaddCart.enabled = NO;
|
|
|
-// }
|
|
|
-//
|
|
|
-// [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}];
|
|
|
|
|
|
@@ -1451,131 +999,17 @@
|
|
|
self.btnaddCart.enabled = NO;
|
|
|
}
|
|
|
|
|
|
- [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
+ [RAUtils message_box:title message:msg completion:nil] ;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
-
|
|
|
-// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork add_toCart:self.product_id count:count name:model_name];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-//
|
|
|
-//
|
|
|
-//#ifdef RA_NOTIFICATION
|
|
|
-// [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
-//#else
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
-//
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
-// [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
-//#endif
|
|
|
-// if(self.shopCartBlock!=nil)
|
|
|
-// {
|
|
|
-// UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-//
|
|
|
-//
|
|
|
-// CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
-// UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// iv.image = img;
|
|
|
-// // [self.contentView addSubview:iv];
|
|
|
-// self.shopCartBlock(iv);
|
|
|
-//
|
|
|
-// self.cqty +=count;
|
|
|
-// if(self.set_cqty)
|
|
|
-// self.set_cqty(self.cqty);
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-//
|
|
|
-// NSString *msg = [return_json valueForKey:@"err_msg"];
|
|
|
-// NSString *title = @"Add To Cart";
|
|
|
-// if ([msg hasPrefix:@"Out of Stock.\n"]) {
|
|
|
-// title = @"Add To Cart: Out of Stock";
|
|
|
-// msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
|
|
|
-// self.btnNotifyMe.enabled = YES;
|
|
|
-// self.btnaddCart.enabled = NO;
|
|
|
-// }
|
|
|
-//
|
|
|
-// [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- //
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
- //
|
|
|
- // NSDictionary* return_json = [iSalesNetwork add_toCart:self.product_id count:count];
|
|
|
- //
|
|
|
- // dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- // if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
- // {
|
|
|
- //
|
|
|
- // // NSString* order_code = [return_json valueForKey:@"order_code"];
|
|
|
- // AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
- //// appDelegate.order_code = order_code;
|
|
|
- ////
|
|
|
- //// AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
- //// appDelegate.order_code = order_code;
|
|
|
- // [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
- //
|
|
|
- //
|
|
|
- // if(self.shopCartBlock!=nil)
|
|
|
- // {
|
|
|
- // UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
- //
|
|
|
- //
|
|
|
- // CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
- // UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
- // iv.image = img;
|
|
|
- // // [self.contentView addSubview:iv];
|
|
|
- // self.shopCartBlock(iv);
|
|
|
- //
|
|
|
- // self.cqty +=count;
|
|
|
- // if(self.set_cqty)
|
|
|
- // self.set_cqty(self.cqty);
|
|
|
- //
|
|
|
- // }
|
|
|
- //
|
|
|
- //
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // UIViewController *vc= [RAUtils getViewController:self];
|
|
|
- // [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:vc] ;
|
|
|
- // }
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- // });
|
|
|
- // });
|
|
|
- //
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -1748,11 +1182,14 @@
|
|
|
-(void) neworder
|
|
|
{
|
|
|
|
|
|
- __block UIAlertController * waitalert = [RAUtils waiting_alert:[RAUtils getViewController:self] title:@"Create Order" completion:^{
|
|
|
+// __block UIAlertController * waitalert = [RAUtils waiting_alert:[RAUtils getViewController:self] title:@"Create Order" completion:^{
|
|
|
+
|
|
|
+ PopWaitAlert* pop = [RAUtils waiting_pop:@"Create Order" completion:nil];
|
|
|
[RANetwork request_create_order:^(NSMutableDictionary *result) {
|
|
|
NSMutableDictionary* return_json = result;
|
|
|
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
+ [pop hide];
|
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
{
|
|
|
int result=[[return_json valueForKey:@"result"] intValue];
|
|
|
@@ -1768,21 +1205,6 @@
|
|
|
[self addtocart:count];
|
|
|
|
|
|
|
|
|
- // [self ReloadData];
|
|
|
-
|
|
|
-
|
|
|
- // if(self.shopCartBlock!=nil)
|
|
|
- // {
|
|
|
- // UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
- //
|
|
|
- //
|
|
|
- // CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
- // UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
- // iv.image = img;
|
|
|
- // // [self.contentView addSubview:iv];
|
|
|
- // self.shopCartBlock(iv);
|
|
|
- //
|
|
|
- // }
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -1798,9 +1220,9 @@
|
|
|
self.btnaddCart.enabled = NO;
|
|
|
}
|
|
|
|
|
|
- [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
+ [RAUtils message_box:title message:msg completion:nil] ;
|
|
|
}
|
|
|
- }];
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1811,200 +1233,9 @@
|
|
|
|
|
|
}];
|
|
|
|
|
|
- }];
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
-//
|
|
|
-// NSDictionary* return_json = [RANetwork new_Order];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
-//
|
|
|
-//
|
|
|
-// if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
-// {
|
|
|
-// int result=[[return_json valueForKey:@"result"] intValue];
|
|
|
-// if(result==2)
|
|
|
-// {
|
|
|
-// //successed.
|
|
|
-//
|
|
|
-// NSString* order_code = [return_json valueForKey:@"orderCode"];
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
-// appDelegate.order_code = order_code;
|
|
|
-//
|
|
|
-// int count=[self.quantity_text.text intValue];
|
|
|
-// [self addtocart:count];
|
|
|
-//
|
|
|
-//
|
|
|
-// // [self ReloadData];
|
|
|
-//
|
|
|
-//
|
|
|
-// // if(self.shopCartBlock!=nil)
|
|
|
-// // {
|
|
|
-// // UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
-// //
|
|
|
-// //
|
|
|
-// // CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
-// // UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
-// // iv.image = img;
|
|
|
-// // // [self.contentView addSubview:iv];
|
|
|
-// // self.shopCartBlock(iv);
|
|
|
-// //
|
|
|
-// // }
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// NSString *msg = [return_json valueForKey:@"err_msg"];
|
|
|
-// NSString *title = @"Add To Cart";
|
|
|
-// if ([msg hasPrefix:@"Out of Stock.\n"]) {
|
|
|
-// title = @"Add To Cart: Out of Stock";
|
|
|
-// msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
|
|
|
-// self.btnNotifyMe.enabled = YES;
|
|
|
-// self.btnaddCart.enabled = NO;
|
|
|
-// }
|
|
|
-//
|
|
|
-// [RAUtils message_alert:msg title:title controller:vc] ;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// });
|
|
|
-// });
|
|
|
-}
|
|
|
-//#pragma mark - UIAlertViewDelegate
|
|
|
-//// Called when a button is clicked. The view will be automatically dismissed after this call returns
|
|
|
-//- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
|
|
|
-//{
|
|
|
-// UIApplication * app = [UIApplication sharedApplication];
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
-// if(alertView.tag==1234)//库存小于0
|
|
|
-// {
|
|
|
-//
|
|
|
-// // availability warring;
|
|
|
-//
|
|
|
-// int count=[self.quantity_text.text intValue];
|
|
|
-// if(buttonIndex!=alertView.cancelButtonIndex)
|
|
|
-// {
|
|
|
-// if(appDelegate.order_code==nil)
|
|
|
-// {
|
|
|
-// [self neworder];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// [self addtocart:count];
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// // int count=[self.quantity_text.text intValue];
|
|
|
-//
|
|
|
-// MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
|
|
|
-// if(buttonIndex==alertView.cancelButtonIndex)
|
|
|
-// {
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-// else if(buttonIndex==1)
|
|
|
-// {
|
|
|
-// //open exist
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// OrderListViewController* ovc =[ [UIStoryboard storyboardWithName:@"ERP_Mobile_Order" bundle:nil] instantiateViewControllerWithIdentifier:@"OrderListViewController"];
|
|
|
-// ovc.showNavibar = true;
|
|
|
-// ovc.selectOrder = ^(NSMutableDictionary* order_detail){
|
|
|
-// if(appDelegate.order_code==nil)
|
|
|
-// {
|
|
|
-// [self neworder];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// if(self.set_update_data)
|
|
|
-// self.set_update_data(true);
|
|
|
-//
|
|
|
-// int model_count = [[order_detail valueForKey:@"model_count"] intValue];
|
|
|
-// for(int i=0;i<model_count;i++)
|
|
|
-// {
|
|
|
-// NSDictionary* item = [order_detail objectForKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
|
-// NSString* product_id = [item valueForKey:@"product_id"];
|
|
|
-// if([product_id isEqualToString:self.product_id])
|
|
|
-// {
|
|
|
-// self.cqty = [[item valueForKey:@"QTY"]intValue];
|
|
|
-// if(self.set_cqty)
|
|
|
-// self.set_cqty(self.cqty);
|
|
|
-// break;
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// int count=[self.quantity_text.text intValue];
|
|
|
-// [self addtocart:count];
|
|
|
-// [main_vc checklogin:true];
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// };
|
|
|
-// ovc.init_style = OL_OPEN;
|
|
|
-// ovc.onCancel = ^(){
|
|
|
-//
|
|
|
-// [main_vc checklogin:true];
|
|
|
-//
|
|
|
-// };
|
|
|
-//
|
|
|
-// [vc.navigationController pushViewController:ovc animated:true];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// //create new;
|
|
|
-// if(appDelegate.customerInfo==nil)// select contact if current contact not exist
|
|
|
-// {
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-//
|
|
|
-//
|
|
|
-// ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
|
|
|
-//
|
|
|
-// cvc.showNavibar = true;
|
|
|
-// cvc.contact_type = @"Sales_Order_Customer";
|
|
|
-// cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
|
|
|
-//
|
|
|
-// appDelegate.contact_id=[value valueForKey:@"customer_cid"];
|
|
|
-// appDelegate.customerInfo = value;
|
|
|
-//
|
|
|
-//
|
|
|
-// if(appDelegate.order_code==nil)
|
|
|
-// [self neworder];
|
|
|
-//
|
|
|
-// [main_vc checklogin:true];
|
|
|
-// // [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
|
|
|
-//
|
|
|
-// //
|
|
|
-// // if(self.returnValue)
|
|
|
-// // self.returnValue(value);
|
|
|
-// };
|
|
|
-//
|
|
|
-// cvc.onCancel = ^(){
|
|
|
-//
|
|
|
-// UIViewController *vc= [RAUtils getViewController:self];
|
|
|
-// [RAUtils message_alert:@"Cannot create order without customer infomation." title:@"New Order" controller:vc];
|
|
|
-//
|
|
|
-// };
|
|
|
-// cvc.onReset = ^(){
|
|
|
-// [main_vc checklogin:true];
|
|
|
-// };
|
|
|
-//
|
|
|
-// [vc.navigationController pushViewController:cvc animated:true];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// [self neworder];
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-//}
|
|
|
+// }];
|
|
|
|
|
|
+}
|
|
|
- (void)valueChanged:(UIStepper *)sender {
|
|
|
|
|
|
|