sync.shop.cs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. using BizCom;
  2. using SQLData;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Text;
  7. namespace SiteCore.Handler
  8. {
  9. public partial class sync
  10. {
  11. //店铺档案管理接口
  12. public void get_erp_shop()
  13. {
  14. DataStruct dStruct = GetPostStruct();
  15. List<string> lw = new List<string>();
  16. string key = GetPostString("key");
  17. if (key.Length > 0) lw.Add(string.Format("shopname like '%{0}%' or sname like '%{0}%' or leadername like '%{0}%'", key));
  18. dStruct.Order = "id desc";
  19. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  20. DataTable dt = WebCache.GetData("view_erpshop", dStruct);
  21. writeGridDataTableJson(dStruct.TotalCount, dt);
  22. }
  23. public void del_erp_shop()
  24. {
  25. if (UrlPostParmsCheck("eid"))
  26. {
  27. int eid = GetPostInt("eid");
  28. CeErpShop.Del(eid);
  29. returnSuccessMsg("删除成功");
  30. }
  31. }
  32. public void save_erp_shop()
  33. {
  34. if (UrlPostParmsCheck("shopname,user"))
  35. {
  36. int eid = GetPostInt("eid");
  37. CeErpShop entity = null;
  38. if (eid > 0) entity = CeErpShop.Get(eid);
  39. else entity = new CeErpShop();
  40. entity.UserID = GetPostInt("user");
  41. entity.ComName = GetPostString("ComName");
  42. entity.AppSecret = GetPostString("AppSecret");
  43. entity.ShopName = GetPostString("ShopName");
  44. entity.design_app_id = GetPostString("design_app_id");
  45. entity.design_secret = GetPostString("design_secret");
  46. entity.SName = GetPostString("SName");
  47. entity.ShopType = GetPostString("ShopType");
  48. entity.platform = GetPostString("platform");
  49. entity.company = GetPostString("company");
  50. entity.State = GetPostInt("State");
  51. entity.orderAudit = GetPostInt("orderAudit") == 0 ? false : true;
  52. entity.AddTime = DateTime.Now;
  53. entity.Summary = GetPostString("con");
  54. if (eid > 0) entity.Update();
  55. else entity.Create();
  56. returnSuccessMsg("保存成功!");
  57. }
  58. }
  59. public void tmc_erp_shop()
  60. {
  61. string sql = "select * from ce_erpshop where appsecret<>'' and taobao_user_nick<>'' and isTmc=0";
  62. DataTable dt = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
  63. foreach (DataRow dr in dt.Rows)
  64. {
  65. taobaoHelper.openTmc(dr["AppSecret"].ToString(), dr["taobao_user_nick"].ToString());
  66. }
  67. returnSuccessMsg("同步授权操作完成");
  68. }
  69. //供应商档案管理接口---------------------------------------------
  70. public void get_erp_supplier()
  71. {
  72. DataStruct dStruct = GetPostStruct();
  73. List<string> lw = new List<string>();
  74. string type = GetPostString("type");
  75. if (type.Length > 0) lw.Add(" SType='" + type + "'");
  76. string key = GetPostString("key");
  77. if (key.Length > 0) lw.Add(string.Format("ComName like '%{0}%' or Leader like '%{0}%'", key));
  78. dStruct.Order = "BSort asc";
  79. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  80. DataTable dt = WebCache.GetData("ce_erpsupplier", dStruct);
  81. writeGridDataTableJson(dStruct.TotalCount, dt);
  82. }
  83. public void del_erp_supplier()
  84. {
  85. if (UrlPostParmsCheck("eid"))
  86. {
  87. int eid = GetPostInt("eid");
  88. CeErpSupplier.Del(eid);
  89. LogHelper.addSupplierLog(CurrentUser.UserID, CurrentUser.UserName, "删除", "");
  90. returnSuccessMsg("删除成功");
  91. }
  92. }
  93. public void save_erp_supplier()
  94. {
  95. if (UrlPostParmsCheck("comname"))
  96. {
  97. int eid = GetPostInt("eid");
  98. CeErpSupplier entity = null;
  99. string oldCon = "";
  100. string newCon = "";
  101. if (eid > 0)
  102. {
  103. entity = CeErpSupplier.Get(eid);
  104. oldCon = entity.ComName + "," + entity.Leader + "," + entity.Summary + "," + entity.SType + "," + entity.Address + "," + entity.Phone;
  105. }
  106. else
  107. {
  108. entity = new CeErpSupplier();
  109. }
  110. entity.ComName = GetPostString("ComName");
  111. entity.Leader = GetPostString("Leader");
  112. entity.Summary = GetPostString("Summary");
  113. entity.SType = GetPostString("SType");
  114. entity.Address = GetPostString("Address");
  115. entity.XianhuoMemo = GetPostString("XianhuoMemo");
  116. entity.Phone = GetPostString("Phone");
  117. entity.BSort = GetPostInt("BSort");
  118. newCon = entity.ComName + "," + entity.Leader + "," + entity.Summary + "," + entity.SType + "," + entity.Address + "," + entity.Phone;
  119. if (eid > 0) entity.Update();
  120. else entity.Create();
  121. LogHelper.addSupplierLog(CurrentUser.UserID, CurrentUser.UserName, oldCon, newCon);
  122. returnSuccessMsg("保存成功!");
  123. }
  124. }
  125. public void upd_supplier_isaftersale()
  126. {
  127. string ison = GetString("ison");
  128. string sid = GetString("sid");
  129. if (sid.Length > 0)
  130. {
  131. int eSid = Convert.ToInt32(sid);
  132. string sql = "";
  133. sql = "update CE_ErpSupplier set IsAfterSale=" + ison + " where id=" + eSid;
  134. DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
  135. returnSuccessMsg("修改成功!");
  136. return;
  137. }
  138. returnErrorMsg("找不到供应商");
  139. }
  140. public void upd_supplier_close()
  141. {
  142. string ison = GetString("isclose");
  143. string sid = GetString("sid");
  144. if (sid.Length > 0)
  145. {
  146. int eSid = Convert.ToInt32(sid);
  147. string sql = "";
  148. sql = "update CE_ErpSupplier set IsClose=" + ison + " where id=" + eSid;
  149. DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
  150. returnSuccessMsg("修改成功!");
  151. return;
  152. }
  153. returnErrorMsg("找不到供应商");
  154. }
  155. //档案-设计产品 管理接口---------------------------------------------
  156. public void get_erp_product()
  157. {
  158. DataStruct dStruct = GetPostStruct();
  159. List<string> lw = new List<string>();
  160. string key = GetPostString("key");
  161. lw.Add(string.Format("isDel = 0"));
  162. if (key.Length > 0) lw.Add(string.Format("PType like '%{0}%' or PMaterial like '%{0}%'", key));
  163. dStruct.Order = "id asc";
  164. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  165. DataTable dt = WebCache.GetData("ce_erpproduct", dStruct);
  166. writeGridDataTableJson(dStruct.TotalCount, dt);
  167. }
  168. public void del_erp_product()
  169. {
  170. if (UrlPostParmsCheck("eid"))
  171. {
  172. int eid = GetPostInt("eid");
  173. CeErpProduct.Del(eid);
  174. returnSuccessMsg("删除成功");
  175. }
  176. }
  177. public void save_erp_product()
  178. {
  179. if (UrlPostParmsCheck("PType"))
  180. {
  181. int eid = GetPostInt("eid");
  182. CeErpProduct entity = null;
  183. if (eid > 0) entity = CeErpProduct.Get(eid);
  184. else entity = new CeErpProduct();
  185. entity.PType = GetPostString("PType");
  186. entity.PName = GetPostString("PName");
  187. entity.PNum = GetPostString("PNum");
  188. entity.PMaterial = GetPostString("PMaterial");
  189. entity.PCraft = GetPostString("PCraft");
  190. entity.SizeUnit = GetPostString("sizeUnit");
  191. entity.UpdateTime = DateTime.Now;
  192. entity.UpdateUserName = CurrentUser.UserName;
  193. entity.uuid = entity.PType;
  194. if (eid > 0) entity.Update();
  195. else
  196. {
  197. CeErpProduct old = CeErpProduct.GetByName(entity.PType);
  198. if (old != null)
  199. {
  200. returnErrorMsg("已存在产品");
  201. return;
  202. }
  203. entity.CreateTime = entity.UpdateTime;
  204. entity.CreateUserName = entity.UpdateUserName;
  205. entity.Create();
  206. }
  207. returnSuccessMsg("保存成功!");
  208. }
  209. }
  210. public void save_product_form_data()
  211. {
  212. if (UrlPostParmsCheck("eid"))
  213. {
  214. int eid = GetPostInt("eid");
  215. string json = GetPostString("json");
  216. CeErpProduct entity = CeErpProduct.Get(eid);
  217. if (entity != null)
  218. {
  219. entity.FormJson = json;
  220. entity.Update();
  221. }
  222. returnSuccessMsg("保存成功!");
  223. }
  224. }
  225. public void upd_erp_productdistribute()
  226. {
  227. if (UrlPostParmsCheck("eid"))
  228. {
  229. int eid = GetPostInt("eid");
  230. CeErpProduct ent = CeErpProduct.Get(eid);
  231. if (ent != null)
  232. {
  233. if (ent.IsAutoDistribute == 0)
  234. {
  235. ent.IsAutoDistribute = 1;
  236. }
  237. else
  238. {
  239. ent.IsAutoDistribute = 0;
  240. }
  241. ent.Update();
  242. returnSuccessMsg("修改成功");
  243. return;
  244. }
  245. returnErrorMsg("找不到记录");
  246. }
  247. }
  248. public void upd_erp_productwriteprice()
  249. {
  250. if (UrlPostParmsCheck("eid"))
  251. {
  252. int eid = GetPostInt("eid");
  253. CeErpProduct ent = CeErpProduct.Get(eid);
  254. if (ent != null)
  255. {
  256. if (ent.IsNeedDesignPrice == 0)
  257. {
  258. ent.IsNeedDesignPrice = 1;
  259. }
  260. else
  261. {
  262. ent.IsNeedDesignPrice = 0;
  263. }
  264. ent.Update();
  265. returnSuccessMsg("修改成功");
  266. return;
  267. }
  268. returnErrorMsg("找不到记录");
  269. }
  270. }
  271. public void upd_erp_product_selectalldesigner()
  272. {
  273. if (UrlPostParmsCheck("eid"))
  274. {
  275. int eid = GetPostInt("eid");
  276. CeErpProduct ent = CeErpProduct.Get(eid);
  277. if (ent != null)
  278. {
  279. if (ent.IsAutoDistribute == 0)
  280. {
  281. ent.IsAutoDistribute = 1;
  282. StringBuilder sql = new StringBuilder();
  283. sql.AppendFormat("update view_ErpUser set pemDesign=pemDesign+'{0}' where PostCode='Designer' and isOpen=1 and CHARINDEX(','+'{0}'+',',','+pemDesign+',')<=0", ent.ID);
  284. DbHelper.DbConn.ExecuteNonQuery(sql.ToString());
  285. }
  286. else
  287. {
  288. ent.IsAutoDistribute = 0;
  289. StringBuilder sql = new StringBuilder();
  290. sql.AppendFormat("select * from view_ErpUser where isOpen=1 and PostCode='Designer' and CHARINDEX(','+'{0}'+',',','+pemDesign+',')>0", ent.ID);
  291. DataTable dt = DbHelper.DbConn.ExecuteDataset(sql.ToString()).Tables[0];
  292. foreach (DataRow dr in dt.Rows)
  293. {
  294. CeErpUser user = CeErpUser.Get(dr["ID"]);
  295. if (user != null)
  296. {
  297. string newDes = "";
  298. string pemDesign = user.pemDesign;
  299. string[] desList = pemDesign.Split(',');
  300. for (int i = 0; i < desList.Length; i++)
  301. {
  302. if (Convert.ToInt32(desList[i]) != ent.ID)
  303. {
  304. newDes += desList[i];
  305. newDes += ",";
  306. }
  307. }
  308. newDes = newDes.Substring(0, newDes.Length - 1);
  309. user.pemDesign = newDes;
  310. user.Update();
  311. }
  312. }
  313. }
  314. ent.Update();
  315. returnSuccessMsg("修改成功");
  316. return;
  317. }
  318. returnErrorMsg("找不到记录");
  319. }
  320. }
  321. //档案-产品工时 管理接口---------------------------------------------
  322. public void get_erp_producthour()
  323. {
  324. DataStruct dStruct = GetPostStruct();
  325. List<string> lw = new List<string>();
  326. string key = GetPostString("key");
  327. if (key.Length > 0) lw.Add(string.Format("PType like '%{0}%' or ProductID like '%{0}%'", key));
  328. dStruct.Order = "kfTime asc";
  329. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  330. DataTable dt = WebCache.GetData("view_erpproducthour", dStruct);
  331. writeGridDataTableJson(dStruct.TotalCount, dt);
  332. }
  333. public void del_erp_producthour()
  334. {
  335. if (UrlPostParmsCheck("eid"))
  336. {
  337. int eid = GetPostInt("eid");
  338. CeErpProductHour.Del(eid);
  339. returnSuccessMsg("删除成功");
  340. }
  341. }
  342. public void save_erp_producthour()
  343. {
  344. if (UrlPostParmsCheck("PType"))
  345. {
  346. int eid = GetPostInt("eid");
  347. CeErpProductHour entity = null;
  348. if (eid > 0) entity = CeErpProductHour.Get(eid);
  349. else entity = new CeErpProductHour();
  350. entity.ProductID = GetPostInt("PType");
  351. entity.Material = GetPostString("Material");
  352. entity.Craft = GetPostString("Craft");
  353. //entity.kfTime = GetPostInt("kfTime");
  354. //entity.dsjTime = GetPostInt("dsjTime");
  355. //entity.sjzTime = GetPostInt("sjzTime");
  356. //entity.xdTime = GetPostInt("xdTime");
  357. entity.fhTime = GetPostInt("fhTime");
  358. if (eid > 0) entity.Update();
  359. else entity.Create();
  360. returnSuccessMsg("保存成功!");
  361. }
  362. }
  363. public void upd_erp_pdhour_sort()
  364. {
  365. if (UrlPostParmsCheck("eid"))
  366. {
  367. int eid = GetPostInt("eid");
  368. CeErpProductHour entity = null;
  369. if (eid > 0) entity = CeErpProductHour.Get(eid);
  370. if (entity != null)
  371. {
  372. entity.kfTime = GetPostInt("sortnum");
  373. entity.Update();
  374. returnSuccessMsg("设置成功");
  375. return;
  376. }
  377. returnErrorMsg("未找到相关数据");
  378. }
  379. }
  380. //档案-供应商产品 管理接口---------------------------------------------
  381. public void get_erp_supplierproduct()
  382. {
  383. DataStruct dStruct = GetPostStruct();
  384. List<string> lw = new List<string>();
  385. string key = GetPostString("key");
  386. if (key.Length > 0) lw.Add(string.Format("ProductName like '%{0}%' or SupplierName like '%{0}%' or ProductCrafts like '%{0}%'", key));
  387. dStruct.Order = "id asc";
  388. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  389. dStruct.Order = "SupplierID asc,Bsort asc";
  390. DataTable dt = WebCache.GetData("view_erpsupplierproduct", dStruct);
  391. writeGridDataTableJson(dStruct.TotalCount, dt);
  392. }
  393. public void del_erp_supplierproduct()
  394. {
  395. if (UrlPostParmsCheck("eid"))
  396. {
  397. int eid = GetPostInt("eid");
  398. CeErpSupplierProduct.Del(eid);
  399. returnSuccessMsg("删除成功");
  400. }
  401. }
  402. public void save_erp_supplierproduct()
  403. {
  404. if (UrlPostParmsCheck("SupplierName"))
  405. {
  406. int eid = GetPostInt("eid");
  407. CeErpSupplierProduct entity = null;
  408. string oldCon = "";
  409. string newCon = "";
  410. if (eid > 0)
  411. {
  412. entity = CeErpSupplierProduct.Get(eid);
  413. }
  414. else
  415. {
  416. entity = new CeErpSupplierProduct();
  417. }
  418. entity.ProductIds = GetPostString("ProductValue");
  419. entity.ProductText = GetPostString("ProductText");
  420. entity.SupplierID = GetPostInt("SupplierName");
  421. entity.ProductCrafts = GetPostString("ProductCrafts");
  422. entity.Crafts = GetPostString("Crafts");
  423. entity.MinNum = GetPostInt("MinNum");
  424. entity.MaxNum = GetPostInt("MaxNum");
  425. entity.SizeL = GetPostInt("SizeL");
  426. entity.SizeW = GetPostInt("SizeW");
  427. entity.Area = GetPostString("Area");
  428. if (eid > 0) entity.Update();
  429. else entity.Create();
  430. //LogHelper.addSupplierLog(CurrentUser.UserID, CurrentUser.UserName, oldCon, newCon);
  431. returnSuccessMsg("保存成功!");
  432. }
  433. }
  434. //档案-开票公司信息---------------------------------------------
  435. public void get_erp_invoicinglist()
  436. {
  437. DataStruct dStruct = GetPostStruct();
  438. List<string> lw = new List<string>();
  439. string key = GetPostString("key");
  440. if (key.Length > 0) lw.Add(string.Format("ComName like '%{0}%' or tax like '%{0}%'", key));
  441. dStruct.Order = "id desc";
  442. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  443. DataTable dt = WebCache.GetData("ce_erpinvoicinginfo", dStruct);
  444. writeGridDataTableJson(dStruct.TotalCount, dt);
  445. }
  446. public void del_erp_invoicing()
  447. {
  448. if (UrlPostParmsCheck("eid"))
  449. {
  450. int eid = GetPostInt("eid");
  451. CeErpInvoicingInfo.Del(eid);
  452. returnSuccessMsg("删除成功");
  453. }
  454. }
  455. public void save_erp_invoicinginfo()
  456. {
  457. if (UrlPostParmsCheck("ComName,tax"))
  458. {
  459. int eid = GetPostInt("eid");
  460. CeErpInvoicingInfo entity = null;
  461. if (eid > 0) entity = CeErpInvoicingInfo.Get(eid);
  462. else entity = new CeErpInvoicingInfo();
  463. entity.ComName = GetPostString("ComName");
  464. entity.CName = GetPostString("CName");
  465. entity.Tax = GetPostString("Tax");
  466. entity.taxrate = GetPostString("taxrate");
  467. entity.Address = GetPostString("Address");
  468. entity.Phone = GetPostString("Phone");
  469. entity.Bank = GetPostString("Bank");
  470. entity.BankAcc = GetPostString("BankAcc");
  471. entity.BillKey = GetPostString("BillKey");
  472. entity.legal = GetPostString("legal");
  473. entity.LimitPrice = Convert.ToDouble(GetPostString("LimitPrice"));
  474. if (eid > 0) entity.Update();
  475. else entity.Create();
  476. returnSuccessMsg("保存成功!");
  477. }
  478. }
  479. //获取买家客户信息
  480. public void get_erp_customerinfo()
  481. {
  482. DataStruct dStruct = GetPostStruct();
  483. List<string> lw = new List<string>();
  484. string key = GetPostString("key");
  485. if (key.Length > 0) lw.Add(string.Format("buyer_nick like '%{0}%' or phone like '%{0}%'", key));
  486. dStruct.Order = "id desc";
  487. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  488. DataTable dt = WebCache.GetData("CE_ErpCustomer", dStruct);
  489. writeGridDataTableJson(dStruct.TotalCount, dt);
  490. }
  491. //行业
  492. public void get_erp_professionlist()
  493. {
  494. DataStruct dStruct = GetPostStruct();
  495. List<string> lw = new List<string>();
  496. string key = GetPostString("key");
  497. if (key.Length > 0) lw.Add(string.Format("Name like '%{0}%'", key));
  498. dStruct.Order = "id desc";
  499. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  500. DataTable dt = WebCache.GetData("CE_ErpProfession", dStruct);
  501. con.Response.Write(Utils.Serialization.JsonString.DataTable2MiniAjaxJson(dt));
  502. }
  503. public void save_erp_profession()
  504. {
  505. if (UrlPostParmsCheck("profession"))
  506. {
  507. int eid = GetPostInt("eid");
  508. CeErpProfession entity = null;
  509. if (eid > 0) entity = CeErpProfession.Get(eid);
  510. else entity = new CeErpProfession();
  511. entity.Name = GetPostString("profession");
  512. string pid = GetPostString("pid");
  513. if (pid.Length > 0)
  514. {
  515. entity.PID = Convert.ToInt32(pid);
  516. }
  517. else
  518. {
  519. entity.PID = -1;
  520. }
  521. if (eid > 0) entity.Update();
  522. else
  523. {
  524. entity.AddTime = DateTime.Now;
  525. entity.Create();
  526. }
  527. returnSuccessMsg("保存成功!");
  528. }
  529. }
  530. public void del_erp_profession()
  531. {
  532. if (UrlPostParmsCheck("eid"))
  533. {
  534. int eid = GetPostInt("eid");
  535. CeErpProfession.Del(eid);
  536. returnSuccessMsg("删除成功");
  537. }
  538. }
  539. //设计费列表
  540. public void get_erp_prdouctPrice()
  541. {
  542. DataStruct dStruct = GetPostStruct();
  543. List<string> lw = new List<string>();
  544. string key = GetPostString("key");
  545. if (key.Length > 0) lw.Add(string.Format("pType like '%{0}%' or tax like '%{0}%'", key));
  546. dStruct.Order = "pType desc";
  547. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  548. DataTable dt = WebCache.GetData("CE_ErpProductPrice", dStruct);
  549. writeGridDataTableJson(dStruct.TotalCount, dt);
  550. }
  551. public void save_erp_productPrice()
  552. {
  553. if (UrlPostParmsCheck("PType"))
  554. {
  555. int eid = GetPostInt("eid");
  556. int pid = GetPostInt("pType");
  557. CeErpProductPrice entity = null;
  558. if (eid > 0) entity = CeErpProductPrice.Get(eid);
  559. else entity = new CeErpProductPrice();
  560. CeErpProduct entitys = CeErpProduct.Get(pid);
  561. entity.pClass = GetPostInt("pClass");
  562. //entity.pClassText = ProductCategory.getText(entity.pClass);
  563. entity.pType = entitys.ID;
  564. entity.pTypeText = entitys.PType;
  565. entity.ws = GetPostDouble("ws");
  566. entity.pMaterial = GetPostString("pMaterial");
  567. entity.modifyPrice = GetPostDouble("modifyPrice");
  568. entity.designPrice = GetPostDouble("designPrice");
  569. if (eid > 0) entity.Update();
  570. else entity.Create();
  571. returnSuccessMsg("保存成功!");
  572. }
  573. }
  574. public void del_erp_productPrice()
  575. {
  576. if (UrlPostParmsCheck("eid"))
  577. {
  578. int eid = GetPostInt("eid");
  579. CeErpProductPrice.Del(eid);
  580. returnSuccessMsg("删除成功");
  581. }
  582. }
  583. //快递管理
  584. public void get_erp_maillist()
  585. {
  586. DataStruct dStruct = GetPostStruct();
  587. List<string> lw = new List<string>();
  588. string key = GetPostString("key");
  589. if (key.Length > 0) lw.Add(string.Format("Name like '%{0}%'", key));
  590. dStruct.Order = "id desc";
  591. dStruct.MainWhere = string.Join(" and ", lw.ToArray());
  592. DataTable dt = WebCache.GetData("CE_ErpMailInfo", dStruct);
  593. con.Response.Write(Utils.Serialization.JsonString.DataTable2MiniAjaxJson(dt));
  594. }
  595. public void save_erp_mailinfo()
  596. {
  597. if (UrlPostParmsCheck("name"))
  598. {
  599. int eid = GetPostInt("eid");
  600. CeErpMailInfo entity = null;
  601. if (eid > 0) entity = CeErpMailInfo.Get(eid);
  602. else entity = new CeErpMailInfo();
  603. entity.name = GetPostString("name");
  604. entity.code = GetPostString("code");
  605. entity.cpCode = GetPostString("cpcode");
  606. if (eid > 0) entity.Update();
  607. else
  608. {
  609. entity.addTime = DateTime.Now;
  610. entity.Create();
  611. }
  612. returnSuccessMsg("保存成功!");
  613. }
  614. }
  615. public void del_erp_mailinfo()
  616. {
  617. if (UrlPostParmsCheck("eid"))
  618. {
  619. int eid = GetPostInt("eid");
  620. CeErpMailInfo.Del(eid);
  621. returnSuccessMsg("删除成功");
  622. }
  623. }
  624. public void upd_mail_auth()
  625. {
  626. int aid = GetPostInt("aid");
  627. int tag = GetPostInt("tag");
  628. CeErpMailInfo entity = null;
  629. if (aid > 0) entity = CeErpMailInfo.Get(aid);
  630. if (entity != null)
  631. {
  632. entity.isAuth = tag;
  633. entity.Update();
  634. returnSuccessMsg("修改成功");
  635. return;
  636. }
  637. returnErrorMsg("没有找到数据");
  638. }
  639. }
  640. }