| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- //
- // 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
|