NetworkUtils+Contact.m 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. //
  2. // NetworkUtils+Contact.m
  3. // RedAnt Mobile
  4. //
  5. // Created by Ray on 08/09/2017.
  6. // Copyright © 2017 Ray. All rights reserved.
  7. //
  8. #import "NetworkUtils+Contact.h"
  9. #import "AppDelegate.h"
  10. @implementation NetworkUtils (Contact)
  11. +(NSDictionary*)request_ContactList:(int) offset limit:(int)limit keywords:(NSString*) keywords type:(NSString*) contact_type adv_search:(NSDictionary*)upparams
  12. {
  13. NSAssert(true, @"未实现");
  14. return nil;
  15. // NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
  16. //
  17. // if(upparams!=nil)
  18. // params = [upparams mutableCopy];
  19. // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
  20. // if(appDelegate.user!=nil)
  21. // [params setValue:appDelegate.user forKey:@"user"];
  22. //
  23. // if(![appDelegate.order_customer_id isEqualToString: appDelegate.contact_id]&& appDelegate.order_customer_id!=nil)
  24. // [params setValue:appDelegate.order_customer_id forKey:@"contactId"];
  25. // else
  26. // [params setValue:appDelegate.contact_id forKey:@"contactId"];
  27. //
  28. // if(appDelegate.password!=nil)
  29. // [params setValue:appDelegate.password forKey:@"password"];
  30. //
  31. // [params setValue:[NSString stringWithFormat:@"%d",offset ] forKey:@"offset"];
  32. // [params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"];
  33. // [params setValue:contact_type forKey:@"contactType"];
  34. // [params setValue:keywords forKey:@"keyword"];
  35. //
  36. // [params setObject:ScreenCodeAccount forKey:kScreenName];
  37. // if (keywords) {
  38. // [params setObject:@"Search" forKey:kAction];
  39. // }
  40. // if (upparams) {
  41. // [params setObject:@"Advance Search" forKey:kAction];
  42. // }
  43. //
  44. // NSString* url=nil;
  45. // if([contact_type isEqualToString:@"Sales_Order_Ship_To"])
  46. // url=URL_SHIPTO_LIST;
  47. // else
  48. // url=URL_CONTACT_LIST;
  49. //
  50. // if(appDelegate.offline_mode)
  51. // return [OLDataProvider offline_contactlist:params];
  52. //
  53. // if(![self IsNetworkAvailable])
  54. // return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
  55. //
  56. // NSData* json=[self get_json:url parameters:params];
  57. // if(json==nil)
  58. // return nil;
  59. // NSError *error=nil;
  60. // NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
  61. // return jsobj;
  62. }
  63. +(NSDictionary*)request_CustomerInfo:(NSString* ) contactid
  64. {
  65. NSAssert(true, @"未实现");
  66. return nil;
  67. // NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
  68. // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
  69. // if(appDelegate.user!=nil)
  70. // [params setValue:appDelegate.user forKey:@"user"];
  71. // // if(appDelegate.contact_id!=nil)
  72. //
  73. // if(appDelegate.password!=nil)
  74. // [params setValue:appDelegate.password forKey:@"password"];
  75. // [params setValue:contactid forKey:@"contactId"];
  76. //
  77. // [params setObject:ScreenCodeCustomerInfo forKey:kScreenName];
  78. //
  79. // if(appDelegate.offline_mode)
  80. // return [OLDataProvider offline_contactinfo:params];
  81. // if(![self IsNetworkAvailable])
  82. // return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
  83. //
  84. // NSData* json=[self get_json:URL_CUSTOMER_INFO parameters:params];
  85. // if(json==nil)
  86. // return nil;
  87. // NSError *error=nil;
  88. // NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
  89. // return jsobj;
  90. }
  91. +(NSDictionary*)create_Address:(NSMutableDictionary*)params
  92. {
  93. NSAssert(true, @"未实现");
  94. return nil;
  95. // // NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
  96. // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
  97. // if(appDelegate.user!=nil)
  98. // [params setValue:appDelegate.user forKey:@"user"];
  99. // if(appDelegate.contact_id!=nil)
  100. // [params setValue:appDelegate.contact_id forKey:@"contactId"];
  101. // if(appDelegate.password!=nil)
  102. // [params setValue:appDelegate.password forKey:@"password"];
  103. // // [params setValue:sourceid forKey:@"sourceid"];
  104. // // [params setValue:editor forKey:@"editor"];
  105. //
  106. // [params setValue:ScreenCodeNewAddress forKey:kScreenName];
  107. //
  108. // NSData* json=nil;
  109. //
  110. // if(appDelegate.offline_mode)
  111. // {
  112. // json= [OLDataProvider offline_saveaddr:params];
  113. // }
  114. // else
  115. // {
  116. // if(![self IsNetworkAvailable])
  117. // return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
  118. //
  119. // json =[self get_json:URL_ADDRESS_SAVE parameters:params];
  120. // }
  121. // if(json!=nil)
  122. // {
  123. // NSError *error=nil;
  124. // NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
  125. // return jsobj;
  126. // }
  127. // else
  128. // return nil;
  129. }
  130. @end