// // NetworkUtils+Contact.m // RedAnt Mobile // // Created by Ray on 08/09/2017. // Copyright © 2017 Ray. All rights reserved. // #import "NetworkUtils+Contact.h" #import "AppDelegate.h" @implementation NetworkUtils (Contact) +(NSDictionary*)request_ContactList:(int) offset limit:(int)limit keywords:(NSString*) keywords type:(NSString*) contact_type adv_search:(NSDictionary*)upparams { NSAssert(true, @"未实现"); return nil; // NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; // // if(upparams!=nil) // params = [upparams mutableCopy]; // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; // if(appDelegate.user!=nil) // [params setValue:appDelegate.user forKey:@"user"]; // // if(![appDelegate.order_customer_id isEqualToString: appDelegate.contact_id]&& appDelegate.order_customer_id!=nil) // [params setValue:appDelegate.order_customer_id forKey:@"contactId"]; // else // [params setValue:appDelegate.contact_id forKey:@"contactId"]; // // if(appDelegate.password!=nil) // [params setValue:appDelegate.password forKey:@"password"]; // // [params setValue:[NSString stringWithFormat:@"%d",offset ] forKey:@"offset"]; // [params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"]; // [params setValue:contact_type forKey:@"contactType"]; // [params setValue:keywords forKey:@"keyword"]; // // [params setObject:ScreenCodeAccount forKey:kScreenName]; // if (keywords) { // [params setObject:@"Search" forKey:kAction]; // } // if (upparams) { // [params setObject:@"Advance Search" forKey:kAction]; // } // // NSString* url=nil; // if([contact_type isEqualToString:@"Sales_Order_Ship_To"]) // url=URL_SHIPTO_LIST; // else // url=URL_CONTACT_LIST; // // if(appDelegate.offline_mode) // return [OLDataProvider offline_contactlist:params]; // // if(![self IsNetworkAvailable]) // return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil]; // // NSData* json=[self get_json:url parameters:params]; // if(json==nil) // return nil; // NSError *error=nil; // NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error]; // return jsobj; } +(NSDictionary*)request_CustomerInfo:(NSString* ) contactid { NSAssert(true, @"未实现"); return nil; // NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; // if(appDelegate.user!=nil) // [params setValue:appDelegate.user forKey:@"user"]; // // if(appDelegate.contact_id!=nil) // // if(appDelegate.password!=nil) // [params setValue:appDelegate.password forKey:@"password"]; // [params setValue:contactid forKey:@"contactId"]; // // [params setObject:ScreenCodeCustomerInfo forKey:kScreenName]; // // if(appDelegate.offline_mode) // return [OLDataProvider offline_contactinfo:params]; // if(![self IsNetworkAvailable]) // return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil]; // // NSData* json=[self get_json:URL_CUSTOMER_INFO parameters:params]; // if(json==nil) // return nil; // NSError *error=nil; // NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error]; // return jsobj; } +(NSDictionary*)create_Address:(NSMutableDictionary*)params { NSAssert(true, @"未实现"); return nil; // // NSMutableDictionary* params = [[NSMutableDictionary alloc] init]; // AppDelegate *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"]; // // [params setValue:sourceid forKey:@"sourceid"]; // // [params setValue:editor forKey:@"editor"]; // // [params setValue:ScreenCodeNewAddress forKey:kScreenName]; // // NSData* json=nil; // // if(appDelegate.offline_mode) // { // json= [OLDataProvider offline_saveaddr:params]; // } // else // { // if(![self IsNetworkAvailable]) // return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil]; // // json =[self get_json:URL_ADDRESS_SAVE parameters:params]; // } // if(json!=nil) // { // NSError *error=nil; // NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error]; // return jsobj; // } // else // return nil; } @end