|
@@ -5062,7 +5062,7 @@ repeat:
|
|
|
// NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
|
|
// NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
|
|
|
// return jsobj;
|
|
// return jsobj;
|
|
|
}
|
|
}
|
|
|
-+(void)request_categorylist: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip completionHandler:(resultHandler)result
|
|
|
|
|
|
|
++(void)request_categorylist: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip completionHandler:(resultHandler)result
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5147,4 +5147,405 @@ repeat:
|
|
|
// return jsobj;
|
|
// return jsobj;
|
|
|
//
|
|
//
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
++(void)request_modeldetail: (NSString* ) item_id model_name:(NSString*) model_name category_id:(NSString*) category_id use_name :(bool) use_name groupName:(NSString *)groupName completionHandler:(resultHandler)result
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+ AppDelegate *appDelegate = nil;
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+ if(appDelegate.user!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.user forKey:@"user"];
|
|
|
|
|
+ if(appDelegate.contact_id!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.contact_id forKey:@"contactId"];
|
|
|
|
|
+ if(appDelegate.password!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.password forKey:@"password"];
|
|
|
|
|
+ if(appDelegate.order_code!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
|
|
+ // [params setValue:[NSString stringWithFormat:@"%d",price_template] forKey:@"price_template"];
|
|
|
|
|
+ // [params setValue:[NSString stringWithFormat:@"%d",customid] forKey:@"custom_id"];
|
|
|
|
|
+ if(use_name)
|
|
|
|
|
+ [params setValue:model_name forKey:@"product_name"];
|
|
|
|
|
+ else
|
|
|
|
|
+ [params setValue:item_id forKey:@"product_id"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [params setValue:category_id forKey:@"category"];
|
|
|
|
|
+
|
|
|
|
|
+ [params setObject:ScreenCodeModelInfo forKey:kScreenName];
|
|
|
|
|
+ [params setObject:@"Open A Model" forKey:kAction];
|
|
|
|
|
+ if (model_name) {
|
|
|
|
|
+ NSDictionary *extra = @{@"ModelName" : model_name};
|
|
|
|
|
+ [params setObject:extra forKey:kExtra];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (groupName.length > 0) {
|
|
|
|
|
+ [params setObject:groupName forKey:@"groupName"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.offline_mode)
|
|
|
|
|
+ {
|
|
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
+ NSMutableDictionary* json = [[OLDataProvider offline_model:params] mutableCopy];
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ result(json);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ [self request_interface:URL_ITEM_DETAIL parameters:params err_record_url:nil completionHandler:result retry:0];
|
|
|
|
|
+
|
|
|
|
|
+//
|
|
|
|
|
+// if(appDelegate.offline_mode)
|
|
|
|
|
+// return [OLDataProvider offline_model:params];
|
|
|
|
|
+//
|
|
|
|
|
+// if(![self IsNetworkAvailable])
|
|
|
|
|
+// return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
|
|
|
|
|
+//
|
|
|
|
|
+// NSData* json=[self get_json:URL_ITEM_DETAIL parameters:params];
|
|
|
|
|
+// if(json==nil)
|
|
|
|
|
+// return nil;
|
|
|
|
|
+// NSError *error=nil;
|
|
|
|
|
+// NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
|
|
|
|
|
+// return jsobj;
|
|
|
|
|
+}
|
|
|
|
|
++(void)request_search:(long ) offset limit :(long)limit keywords :(NSString*) keywords matchfull:(bool)matchfull completionHandler:(resultHandler)result
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+ AppDelegate *appDelegate = nil;
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+ if(appDelegate.user!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.user forKey:@"user"];
|
|
|
|
|
+ if(appDelegate.contact_id!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.contact_id forKey:@"contactId"];
|
|
|
|
|
+ if(appDelegate.password!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.password forKey:@"password"];
|
|
|
|
|
+ if(appDelegate.order_code!=nil)
|
|
|
|
|
+ [params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
|
|
+ // [params setValue:[NSString stringWithFormat:@"%d",price_template] forKey:@"price_template"];
|
|
|
|
|
+ // [params setValue:[NSString stringWithFormat:@"%d",customid] forKey:@"custom_id"];
|
|
|
|
|
+ // [params setValue:[NSString stringWithFormat:@"%@",category] forKey:@"category"];
|
|
|
|
|
+ // [params setValue:[NSString stringWithFormat:@"%d",sort_by] forKey:@"sort_by"];
|
|
|
|
|
+ // [params setValue:filter forKey:@"filter"];
|
|
|
|
|
+ [params setValue:keywords forKey:@"keyword"];
|
|
|
|
|
+
|
|
|
|
|
+ [params setValue:[NSString stringWithFormat:@"%ld",limit] forKey:@"limit"];
|
|
|
|
|
+ [params setValue:[NSString stringWithFormat:@"%ld",offset] forKey:@"offset"];
|
|
|
|
|
+ if(matchfull)
|
|
|
|
|
+ [params setValue:@"true" forKey:@"exactMatch"];
|
|
|
|
|
+ else
|
|
|
|
|
+ [params setValue:@"false" forKey:@"exactMatch"];
|
|
|
|
|
+
|
|
|
|
|
+ [params setObject:ScreenCodeSearch forKey:kScreenName];
|
|
|
|
|
+ if (keywords) {
|
|
|
|
|
+ [params setObject:@"Search" forKey:kAction];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.offline_mode)
|
|
|
|
|
+ {
|
|
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
+ NSMutableDictionary* json = [[OLDataProvider offline_search:params] mutableCopy];
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ result(json);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ [self request_interface:URL_SEARCH parameters:params err_record_url:nil completionHandler:result retry:0];
|
|
|
|
|
+// if(appDelegate.offline_mode)
|
|
|
|
|
+// {
|
|
|
|
|
+// return [OLDataProvider offline_search:params];
|
|
|
|
|
+// }
|
|
|
|
|
+// if(![self IsNetworkAvailable])
|
|
|
|
|
+// return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
|
|
|
|
|
+//
|
|
|
|
|
+// NSData* json=[self get_json:URL_SEARCH parameters:params];
|
|
|
|
|
+// if(json==nil)
|
|
|
|
|
+// return nil;
|
|
|
|
|
+// NSError *error=nil;
|
|
|
|
|
+// NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
|
|
|
|
|
+// return jsobj;
|
|
|
|
|
+}
|
|
|
|
|
++(void)request_login: (NSString*) user password:(NSString*) password completionHandler:(resultHandler)result
|
|
|
|
|
+{
|
|
|
|
|
+
|
|
|
|
|
+ // if(![ApexMobileNetwork IsHostAvailable:URL_UPDATE_AUTH])
|
|
|
|
|
+ // return RESULT_NET_ERROR;
|
|
|
|
|
+ NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
|
|
|
|
|
+ long ver =[defaults integerForKey:[NSString stringWithFormat:@"%@_Auth_InfoVer",user]];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
|
|
+ AppDelegate *appDelegate = nil;
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.duid !=nil)
|
|
|
|
|
+ [params setValue:appDelegate.duid forKey:@"udid"];
|
|
|
|
|
+ [params setValue:@"handset_login" forKey:@"action"];
|
|
|
|
|
+ // [headers setValue:[NSString stringWithFormat:@"%d",dataLength] forKey:@"Content-Length"];
|
|
|
|
|
+
|
|
|
|
|
+ [params setValue:user forKey:@"user"];
|
|
|
|
|
+ [params setValue:password forKey:@"password"];
|
|
|
|
|
+ [params setValue:[NSString stringWithFormat:@"%ld",ver] forKey:@"auth_ver"];
|
|
|
|
|
+#ifdef TEST
|
|
|
|
|
+ [params setValue:@"true" forKey:@"is_debug"];
|
|
|
|
|
+#else
|
|
|
|
|
+ [params setValue:@"false" forKey:@"is_debug"];
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+ [params setObject:ScreenCodeLoginView forKey:kScreenName];
|
|
|
|
|
+ [params setObject:@"Login" forKey:kAction];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.offline_mode)
|
|
|
|
|
+ {
|
|
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* json = [[RAConvertor data2dict:[OLDataProvider offline_login:params]] mutableCopy];
|
|
|
|
|
+ int ret = [self parse_logininfo:json user:user password:password] ;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary * retjson = [NSMutableDictionary new];
|
|
|
|
|
+
|
|
|
|
|
+ retjson[@"result"]= [NSNumber numberWithInt:ret];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ result(retjson);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ [self request_interface:URL_UPDATE_AUTH parameters:params err_record_url:nil completionHandler:^(NSMutableDictionary *chresult) {
|
|
|
|
|
+ int ret = [self parse_logininfo:chresult user:user password:password] ;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary * retjson = [NSMutableDictionary new];
|
|
|
|
|
+
|
|
|
|
|
+ retjson[@"result"]= [NSNumber numberWithInt:ret];
|
|
|
|
|
+
|
|
|
|
|
+ result(retjson);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ } retry:0];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//
|
|
|
|
|
+// NSData* json= nil;
|
|
|
|
|
+// if(appDelegate.offline_mode)
|
|
|
|
|
+// {
|
|
|
|
|
+// json= [OLDataProvider offline_login:params] ;
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+// else
|
|
|
|
|
+// {
|
|
|
|
|
+// if(![self IsNetworkAvailable])
|
|
|
|
|
+// return RESULT_NET_NOTAVAILABLE;
|
|
|
|
|
+// json =[self get_json:URL_UPDATE_AUTH parameters:params];
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// if(json==nil)
|
|
|
|
|
+// return RESULT_NET_ERROR;
|
|
|
|
|
+//
|
|
|
|
|
+// int ret = [self parse_authinfo:json user:user password:password];
|
|
|
|
|
+// DebugLog(@"parse_authinfo return %d ",ret);
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// return ret;
|
|
|
|
|
+//
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
++(int)parse_logininfo : (NSMutableDictionary *) jsobj user:(NSString*) user password:(NSString*) password
|
|
|
|
|
+{
|
|
|
|
|
+// DebugLog(@"parse_authinfo");
|
|
|
|
|
+// NSError *error=nil;
|
|
|
|
|
+//
|
|
|
|
|
+// NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
|
|
|
|
|
+ if(jsobj)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ __block AppDelegate *appDelegate = nil;
|
|
|
|
|
+
|
|
|
|
|
+ dispatch_sync(dispatch_get_main_queue(), ^{
|
|
|
|
|
+ //some UI methods ej
|
|
|
|
|
+ appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
+ });
|
|
|
|
|
+ int result = [[jsobj valueForKey:@"result"] intValue];
|
|
|
|
|
+
|
|
|
|
|
+ if (result<0)
|
|
|
|
|
+ return result;
|
|
|
|
|
+ if(result!=AP_USER_AUTH&& result!=9)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ DebugLog(@"USER NOT AUTHORIZED CODE=%d ",result);
|
|
|
|
|
+// [appDelegate Logout];
|
|
|
|
|
+ if(result==8)
|
|
|
|
|
+ {
|
|
|
|
|
+ return RESULT_LOGIN_DEVICE;
|
|
|
|
|
+ }
|
|
|
|
|
+ return RESULT_FALSE;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ NSDictionary* objheader = [jsobj objectForKey:@"header"];
|
|
|
|
|
+
|
|
|
|
|
+ NSString* required_ver=[jsobj objectForKey:@"min_ver"] ;
|
|
|
|
|
+ user=[objheader objectForKey:@"username"] ;
|
|
|
|
|
+ DebugLog(@"required_ver=%@ ",required_ver);
|
|
|
|
|
+ // NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
|
|
|
|
|
+ // NSString* versionNum =[infoDict valueForKey:@"CFBundleVersion"];
|
|
|
|
|
+ // versionNum = [NSString stringWithFormat:@"A%@",versionNum];
|
|
|
|
|
+ int ibadge = [[objheader valueForKey:@"badge"] intValue];
|
|
|
|
|
+
|
|
|
|
|
+ // if([ibadge isEqual:[NSNull null]])
|
|
|
|
|
+ // strbadge=@"0";
|
|
|
|
|
+ // if(ibadge==nil)
|
|
|
|
|
+ // ibadge=@"0";
|
|
|
|
|
+ // if([strbadge isEqualToString:@"null"])
|
|
|
|
|
+ // strbadge=@"0";
|
|
|
|
|
+// app.applicationIconBadgeNumber = ibadge;//[strbadge intValue];
|
|
|
|
|
+
|
|
|
|
|
+ // BOOL bigger = [appDelegate.build compare:required_ver] ;
|
|
|
|
|
+ if([appDelegate.build intValue]<[required_ver intValue])
|
|
|
|
|
+ return RESULT_VER_LOW;
|
|
|
|
|
+ // appDelegate.sessionid = [objheader valueForKey:@"sessionid"];
|
|
|
|
|
+ appDelegate.user = user;
|
|
|
|
|
+ appDelegate.password = password;
|
|
|
|
|
+ appDelegate.user_type = [[objheader valueForKey:@"user_type"] intValue];
|
|
|
|
|
+ appDelegate.user_icon =[objheader valueForKey:@"user_img"] ;
|
|
|
|
|
+ appDelegate.bLogin = true;
|
|
|
|
|
+ appDelegate.customer_type = [[objheader valueForKey:@"customer_login_type"] integerValue];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.user_type==USER_ROLE_CUSTOMER)
|
|
|
|
|
+ {
|
|
|
|
|
+ appDelegate.customerInfo = [[objheader objectForKeyedSubscript:@"customerInfo"] mutableCopy];
|
|
|
|
|
+ appDelegate.contact_id = [objheader valueForKey:@"contact_id"];
|
|
|
|
|
+// appDelegate.order_code =[objheader valueForKey:@"orderCode"];
|
|
|
|
|
+// appDelegate.order_status =[[objheader valueForKey:@"orderStatus"] intValue];
|
|
|
|
|
+// [appDelegate SetSo:[objheader valueForKey:@"soId"]];
|
|
|
|
|
+ }
|
|
|
|
|
+ NSString* mode =[jsobj valueForKey:@"mode"] ;
|
|
|
|
|
+ [appDelegate SetMode:mode];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.cart_count = [[objheader valueForKey:@"cart_count"] intValue];
|
|
|
|
|
+ appDelegate.wish_count =[[objheader valueForKey:@"wish_count"] intValue];
|
|
|
|
|
+ appDelegate.port_count =[[objheader valueForKey:@"portfolio_count"] intValue];
|
|
|
|
|
+
|
|
|
|
|
+ [appDelegate update_count_mark];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.can_show_price =[[objheader valueForKey:@"can_show_price"] boolValue];
|
|
|
|
|
+ appDelegate.can_see_price =[[objheader valueForKey:@"can_see_price"] boolValue];
|
|
|
|
|
+ appDelegate.can_create_portfolio =[[objheader valueForKey:@"can_create_portfolio"] boolValue];
|
|
|
|
|
+ appDelegate.can_create_order =[[objheader valueForKey:@"can_create_order"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.can_cancel_order =[[objheader valueForKey:@"can_cancel_order"] boolValue];
|
|
|
|
|
+ appDelegate.can_set_cart_price =[[objheader valueForKey:@"can_set_cart_price"] boolValue];
|
|
|
|
|
+ appDelegate.can_delete_order =[[objheader valueForKey:@"can_delete_order"] boolValue];
|
|
|
|
|
+ appDelegate.can_update_contact_info =[[objheader valueForKey:@"can_update_contact_info"] boolValue];
|
|
|
|
|
+ appDelegate.can_submit_order =[[objheader valueForKey:@"can_submit_order"] boolValue];
|
|
|
|
|
+ appDelegate.can_set_tearsheet_price =[[objheader valueForKey:@"can_set_tearsheet_price"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.save_order_logout =[[objheader valueForKey:@"save_order_logout"] boolValue];
|
|
|
|
|
+ appDelegate.submit_order_logout =[[objheader valueForKey:@"submit_order_logout"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.alert_sold_in_quantities = [[objheader valueForKey:@"alert_sold_in_quantities"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.can_create_backorder = [[objheader valueForKey:@"can_create_backorder"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.ipad_perm =[objheader valueForKey:@"ipad_perm"] ;
|
|
|
|
|
+
|
|
|
|
|
+ NSString* strfilter = [objheader valueForKey:@"statusFilter"] ;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ appDelegate.OrderFilter= [[RAConvertor string2dict:strfilter] mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [appDelegate set_main_button_panel];
|
|
|
|
|
+
|
|
|
|
|
+ if(appDelegate.user_type==USER_ROLE_CUSTOMER) {
|
|
|
|
|
+
|
|
|
|
|
+ // shop order status filter
|
|
|
|
|
+ NSString *shopOrderStatusFilterStr = [objheader valueForKey:@"shopOrderFilter"] ;
|
|
|
|
|
+ [Singleton sharedInstance].shop_order_status_filter = [[RAConvertor string2dict:shopOrderStatusFilterStr] mutableCopy];
|
|
|
|
|
+ // Sales order status filter
|
|
|
|
|
+ NSString *salesOrderStatusFilterStr = [objheader valueForKey:@"purchaseOrderFilter"] ;
|
|
|
|
|
+ [Singleton sharedInstance].sales_order_status_filter = [[RAConvertor string2dict:salesOrderStatusFilterStr] mutableCopy];
|
|
|
|
|
+
|
|
|
|
|
+ // specialInstruction
|
|
|
|
|
+ [Singleton sharedInstance].specialInstruction = [objheader valueForKey:@"specialInstruction"];
|
|
|
|
|
+
|
|
|
|
|
+ //-价格类型
|
|
|
|
|
+ [Singleton sharedInstance].npd_shop_price_type = [[objheader valueForKey:@"price_type"] integerValue];
|
|
|
|
|
+
|
|
|
|
|
+ // 权限
|
|
|
|
|
+ [Singleton sharedInstance].permissions_price_setting = [[objheader valueForKey:@"can_set_price_formula"] boolValue];
|
|
|
|
|
+ [Singleton sharedInstance].permissions_edit_order = [[objheader valueForKey:@"can_place_order"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ [Singleton sharedInstance].permissions_submit_order = [[objheader valueForKey:@"can_submit_order"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ [Singleton sharedInstance].permissions_merge_order = [[objheader valueForKey:@"can_merge_order"] boolValue];
|
|
|
|
|
+
|
|
|
|
|
+ [Singleton sharedInstance].deliveryString = [objheader valueForKey:@"delivery_price"];
|
|
|
|
|
+ [[Singleton sharedInstance] resetGlobalLock];
|
|
|
|
|
+ [Singleton sharedInstance].customer_can_see_sales_Order = [[objheader valueForKey:@"can_see_salesorder"] boolValue];
|
|
|
|
|
+ [Singleton sharedInstance].customerInfo = [objheader objectForKeyedSubscript:@"customerInfo"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // DebugLog(@"sessionid=%@ ",appDelegate.sessionid);
|
|
|
|
|
+ // if ([[objheader valueForKey:@"update"] boolValue]==false)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // // no update on the server;
|
|
|
|
|
+ // return RESULT_TRUE;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // int Auth_InfoVer = [[objheader valueForKey:@"ver"] intValue];
|
|
|
|
|
+ // NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
|
|
|
|
|
+ // [defaults removeObjectForKey:[NSString stringWithFormat:@"%@_Auth_InfoVer",user]];
|
|
|
|
|
+ // [defaults setInteger:Auth_InfoVer forKey:[NSString stringWithFormat:@"%@_Auth_InfoVer",user]];
|
|
|
|
|
+ // [defaults synchronize];
|
|
|
|
|
+ //
|
|
|
|
|
+ // NSDictionary* objfuncs = [jsobj objectForKey:@"functions"];
|
|
|
|
|
+ // NSArray* keys= [objfuncs allKeys];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+
|
|
|
|
|
+ db.setTransactionSuccessful();
|
|
|
|
|
+ db.endTransaction();
|
|
|
|
|
+ */
|
|
|
|
|
+ return RESULT_TRUE;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ // NSDictionary *weatherInfo = [jsobj objectForKey:@"weatherinfo"];
|
|
|
|
|
+ // txtView.text = [NSString stringWithFormat:@"今天是 %@ %@ %@ 的天气状况是:%@ %@ ",[weatherInfo objectForKey:@"date_y"],[weatherInfo objectForKey:@"week"],[weatherInfo objectForKey:@"city"], [weatherInfo objectForKey:@"weather1"], [weatherInfo objectForKey:@"temp1"]];
|
|
|
|
|
+ // DebugLog(@"weatherInfo字典里面的内容为--》%@", weatherDic );
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ return RESULT_USERAUTH_ERROR;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
@end
|
|
@end
|