PurOrderDAL.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. using Common.Model;
  2. using Common.Wechat;
  3. using CoreEntity.BAL;
  4. using CoreEntity.Entity;
  5. using PublicLibrary.Common;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Data;
  9. using System.Data.SqlClient;
  10. using System.Text;
  11. using ZcPeng.PublicLibrary;
  12. using ZcPeng.weixin.PublicAccount;
  13. namespace CoreEntity.DAL
  14. {
  15. public class PurOrderDAL
  16. {
  17. //public const string ENTID = "E2IR7T9P4OI";
  18. //public const string ORGID = "O2IR7T92J72";
  19. //public const string DEPID = "K2J67PCXWG4";
  20. //public const string payorgid = ORGID;
  21. public const string ruleid = "5x80rrxrb24q2ktt";
  22. /// 添加采购计划记录到erp
  23. /// SuppliersId 是根据来往单位(BusinnesDoc)是否供货生成的供应商表(SupplierDoc)记录的id
  24. /// 如果传入BusinnesId BusinessCode:
  25. /// 查询 SuppliersId 来往单位(BusinnesDoc)Is_Supp 设置Y
  26. /// 如果传入SuppliersId:不需要 BusinessId BusinessCode
  27. public static IDictionary<string, Object> AddOrder(
  28. string PushAccountId
  29. ,string PlanBillNo
  30. , string EntId, int ReceiptMd, int CentPayMd
  31. , string OrgId, string DeptId
  32. , string Summaries, string Remark
  33. , string GoodsId, string SuppliersId
  34. , string BusinessId, string BusinessCode
  35. , string StaffDocId
  36. , string RequestDate
  37. , string ContactId
  38. , out int BillNo
  39. , out int OrderBillCodeNo
  40. , decimal PrepayAmt
  41. , string IsPrepay
  42. , string OppContId
  43. , List<DataAccessCommand> listcmd = null
  44. )
  45. {
  46. IDictionary<string, Object> resultdic = new Dictionary<string, Object>(6);
  47. //查询供应商业务员ID
  48. if(string.IsNullOrEmpty(ContactId))
  49. ContactId = AccountDAL.getContactor(PushAccountId, BusinessId);
  50. //查询或生成 SuppliersId
  51. #region SuppliersId
  52. string address = "";
  53. SuppliersId = BusinessId;
  54. if(SuppliersId == "" || SuppliersId == null)
  55. {
  56. ContactDoc cd = ContactDAL.getContactor(ContactId);
  57. if(cd!=null)
  58. SuppliersId = cd.ContactId;
  59. }
  60. //if (BusinessCode != null && BusinessCode != ""
  61. // && BusinessId != null && BusinessId != "")
  62. //{
  63. // SupplyDoc sups = null;
  64. // sups = SupplyDAL.getSupply(BusinessCode);
  65. // if (SuppliersId == null) {
  66. // SuppliersId = sups.SuppliersId;
  67. // address = sups.DftAddress;
  68. // }
  69. // if (sups != null)
  70. // {
  71. // address = sups.DftAddress;
  72. // }
  73. //}
  74. #endregion
  75. //新建推送记录
  76. #region 添加订单
  77. string commandTextRecord = "INSERT INTO "
  78. + "PurOrderMT (BillNo,"
  79. + "EntId,"
  80. + "BillCode,"
  81. + "RuleId,"
  82. + "Dates,"
  83. + "OnTime,"
  84. + "SysDates,"
  85. + "IsVAT,"
  86. + "ExpectDate,"
  87. + "SuppliersId,"
  88. + "Address,"
  89. + "AccptId,"
  90. + "CurrencyId,"
  91. + "SaleManId,"
  92. + "caozy,"
  93. + "OrgId,"
  94. + "DeptId,"
  95. + "ContractCode,"
  96. + "Delivery,"
  97. + "PayType,"
  98. + "OlderNo,"
  99. + "IsEnd,"
  100. + "IsDone,"
  101. + "Summaries,"
  102. + "Remark,"
  103. + "PayOrgId,"
  104. + "ReqDate,"
  105. + "BillState,"
  106. + "OppContId,"
  107. + "IsPrepay,"
  108. + "PrepayAmt,"
  109. + "IsDefray,"
  110. + "IsSuppOut,"
  111. + "SuppOutDate,"
  112. + "GoodsGList,"
  113. //+ "k_isbh,"
  114. //+ "k_kdcode,"
  115. //+ "k_qrdates,"
  116. //+ "k_xspay,"
  117. //+ "k_pay,"
  118. //+ "k_isdz,"
  119. //+ "k_iskd,"
  120. //+ "ECShopId,"
  121. //+ "k_issj,"
  122. + "K_IsBillClose,"
  123. + "K_CloseStaffId,"
  124. + "K_CloseTime,"
  125. + "K_CloseRemark,"
  126. //+ "K_yingfk,"
  127. //+ "K_yufk,"
  128. //+ "K_yfzffs,"
  129. + "K_AutoTbbl,"
  130. //+ "ReBillNo,"
  131. + "K_IsLS,"
  132. + "K_IsYXD,"
  133. + "K_yfkye,"
  134. + "K_yfye,"
  135. + "K_ye,"
  136. + "ReBillNo,"
  137. + "K_ContactId,"
  138. + "source"
  139. + ")"
  140. + " VALUES (@BillNo,@EntId,@BillCode,@RuleId,@Dates,"
  141. + "@OnTime,@SysDates,"
  142. + "@IsVAT,@ExpectDate,@SuppliersId,"
  143. + "@Address,@AccptId,@CurrencyId,@SaleManId,@caozy,"
  144. + "@OrgId,@DeptId,@ContractCode,@Delivery,@PayType,"
  145. + "@OlderNo,@IsEnd,@IsDone,@Summaries,@Remark,"
  146. + "@PayOrgId,@ReqDate,@BillState,@OppContId,@IsPrepay,"
  147. + "@PrepayAmt,@IsDefray,@IsSuppOut,@SuppOutDate,@GoodsGList,"
  148. + "@K_IsBillClose,@K_CloseStaffId,@K_CloseTime,@K_CloseRemark,@K_AutoTbbl,"
  149. + "@K_IsLS,@K_IsYXD,@K_yfkye,@K_yfye,@K_ye,@ReBillNo,@K_ContactId,'coop.360lj.com'"
  150. + ")";
  151. string resultRecord;
  152. //准备参数
  153. Guid PushRecordId = Guid.NewGuid();
  154. List<List<Object>> parametersRecord = new List<List<Object>>();
  155. //订单汇总里面关键的几个字段
  156. ///一个是billno在智友的syscode表中prefix = 'F'的即为最大编号,
  157. ///一个是billcode在智友的billcode表中,需要对应的是采购订单的RULEID(固定5x80rrxrb24q2ktt),
  158. ///从billcode表中取到recnum,billcode的生成规则:PDD+机构标识+8位长度的流水码(recnum,不足补零)例如PDD+Y30+00000058
  159. ///订单明细中没有BILLCODE,但是有billsn,即明细的序号
  160. Int32 OrderBillNo = Convert.ToInt32(IDHelper.GetRecNo());
  161. OrderBillCodeNo = 0;
  162. BillNo = OrderBillNo;
  163. if (BillNo == 0)
  164. {
  165. return resultdic;
  166. }
  167. OrderBillCodeNo = Convert.ToInt32(IDHelper.GetBillCodeRecNo(EntId));
  168. if (OrderBillCodeNo == 0)
  169. {
  170. return resultdic;
  171. }
  172. //取ordercode
  173. string orderNo = OrderBillCodeNo.ToString();
  174. StringBuilder sb = new StringBuilder("");
  175. if (orderNo.Length < 8)
  176. {
  177. for (int i=0;i< (8 - orderNo.Length); i++)
  178. {
  179. sb.Append('0');
  180. }
  181. sb.Append(orderNo);
  182. }
  183. string orgno = OrgDAL.GetOrgNo(OrgId,EntId);
  184. String OrderCode = "PDD" + orgno//机构标识
  185. + sb.ToString();
  186. parametersRecord.Add(new List<Object>() { "BillNo", OrderBillNo });
  187. parametersRecord.Add(new List<Object>() { "EntId", EntId });
  188. parametersRecord.Add(new List<Object>() { "BillCode", OrderCode });
  189. parametersRecord.Add(new List<Object>() { "RuleId", ruleid });
  190. parametersRecord.Add(new List<Object>() { "Dates", DateTime.Now.ToString("yyyy-MM-dd") });
  191. parametersRecord.Add(new List<Object>() { "OnTime", DateTime.Now.ToString("T") });
  192. parametersRecord.Add(new List<Object>() { "SysDates", DateTime.Now.ToString("yyyy-MM-dd") });
  193. parametersRecord.Add(new List<Object>() { "IsVAT", 'Y' });
  194. parametersRecord.Add(new List<Object>() { "ExpectDate", "" });
  195. parametersRecord.Add(new List<Object>() { "SuppliersId", SuppliersId });
  196. parametersRecord.Add(new List<Object>() { "Address", address });
  197. parametersRecord.Add(new List<Object>() { "AccptId", "" });
  198. parametersRecord.Add(new List<Object>() { "CurrencyId", "CNY" });
  199. parametersRecord.Add(new List<Object>() { "SaleManId", StaffDocId });
  200. parametersRecord.Add(new List<Object>() { "caozy", StaffDocId });
  201. parametersRecord.Add(new List<Object>() { "OrgId", OrgId });
  202. parametersRecord.Add(new List<Object>() { "DeptId", DeptId });
  203. parametersRecord.Add(new List<Object>() { "ContractCode", "" });
  204. parametersRecord.Add(new List<Object>() { "Delivery", ReceiptMd });
  205. Option PayType;
  206. PushRecordDAL.OptionCentPayMap.TryGetValue(CentPayMd, out PayType);
  207. parametersRecord.Add(new List<Object>() { "PayType", PayType.label});
  208. parametersRecord.Add(new List<Object>() { "OlderNo", "" });
  209. parametersRecord.Add(new List<Object>() { "IsEnd", 'Y' });
  210. parametersRecord.Add(new List<Object>() { "IsDone", 'N' });
  211. parametersRecord.Add(new List<Object>() { "Summaries", "采购订单" });
  212. parametersRecord.Add(new List<Object>() { "Remark", Remark });
  213. parametersRecord.Add(new List<Object>() { "PayOrgId", OrgId });
  214. parametersRecord.Add(new List<Object>() { "ReqDate", RequestDate });
  215. parametersRecord.Add(new List<Object>() { "BillState", 0});
  216. parametersRecord.Add(new List<Object>() { "OppContId", OppContId });
  217. parametersRecord.Add(new List<Object>() { "PrepayAmt", PrepayAmt });
  218. parametersRecord.Add(new List<Object>() { "IsPrepay", IsPrepay });
  219. parametersRecord.Add(new List<Object>() { "IsDefray", 'N' });//已支付
  220. parametersRecord.Add(new List<Object>() { "IsSuppOut", 'N' });//已发货
  221. parametersRecord.Add(new List<Object>() { "SuppOutDate", "" });//发货日期
  222. parametersRecord.Add(new List<Object>() { "GoodsGList", "" });//互斥分组列表
  223. //parametersRecord.Add(new List<Object>() { "k_isbh", "" });
  224. //parametersRecord.Add(new List<Object>() { "k_kdcode", "" });
  225. //parametersRecord.Add(new List<Object>() { "k_qrdates", "" });
  226. //parametersRecord.Add(new List<Object>() { "k_xspay", "" });
  227. //parametersRecord.Add(new List<Object>() { "k_pay", "" });
  228. //parametersRecord.Add(new List<Object>() { "k_isdz", "" });
  229. //parametersRecord.Add(new List<Object>() { "k_iskd", "" });
  230. //parametersRecord.Add(new List<Object>() { "ECShopId", "" });
  231. //parametersRecord.Add(new List<Object>() { "k_issj", "" });
  232. parametersRecord.Add(new List<Object>() { "k_IsBillClose", 'N' });//
  233. parametersRecord.Add(new List<Object>() { "K_CloseStaffId", "" });
  234. parametersRecord.Add(new List<Object>() { "K_CloseTime", "" });
  235. parametersRecord.Add(new List<Object>() { "K_CloseRemark", "" });
  236. //parametersRecord.Add(new List<Object>() { "K_yingfk", "" });
  237. //parametersRecord.Add(new List<Object>() { "K_yufk", "" });
  238. //parametersRecord.Add(new List<Object>() { "K_yfzffs", "" });
  239. parametersRecord.Add(new List<Object>() { "K_AutoTbbl", 0 });
  240. //parametersRecord.Add(new List<Object>() { "ReBillNo", "" });
  241. parametersRecord.Add(new List<Object>() { "K_IsLS", 'Y' });
  242. parametersRecord.Add(new List<Object>() { "K_IsYXD", 'N' });
  243. parametersRecord.Add(new List<Object>() { "K_yfkye", null });
  244. parametersRecord.Add(new List<Object>() { "K_yfye", null });
  245. parametersRecord.Add(new List<Object>() { "K_ye", null });
  246. parametersRecord.Add(new List<Object>() { "ReBillNo", PlanBillNo });
  247. parametersRecord.Add(new List<Object>() { "K_ContactId", ContactId });
  248. List<SqlParameter> parametersRecord1 = DataAccess.ToParameters(parametersRecord);
  249. #endregion
  250. //int successRecord1 = DataAccess.ExecuteCommand(commandTextRecord, parametersRecord1, out resultRecord);
  251. if (listcmd != null) {
  252. listcmd.Add(new DataAccessCommand(commandTextRecord, parametersRecord1));
  253. }
  254. else {
  255. int successRecord = DataAccess.ExecuteCommand(commandTextRecord, parametersRecord1, out resultRecord);
  256. resultdic.Add("successRecord", successRecord);
  257. resultdic.Add("resultRecord", resultRecord);
  258. resultdic.Add("OrderBillNo", OrderBillNo);
  259. resultdic.Add("OrderCode", OrderCode);
  260. }
  261. return resultdic;
  262. }
  263. public static IDictionary<string, Object> AddOrderDT(
  264. Int32 OrderBillNo,Int32 BillSn,
  265. int PlanBillNo, Int32 PlanBillSn,string PlanBillCode,
  266. string GoodsId,string GoodsSpec, Decimal GoodsGapNum ,
  267. Decimal LastPrice , Decimal K_Price, string Remark,
  268. string EntId,string OrgId,
  269. string BusinessId, string BusinessCode,
  270. string SuppliersId,
  271. Decimal PurchaseTotalNum, Int32 SafeDays
  272. , string LoginAccountId
  273. , List<DataAccessCommand> listcmd = null)
  274. {
  275. IDictionary<string, Object> resultdic = new Dictionary<string, Object>(6);
  276. //新建推送明细记录
  277. #region 添加推送明细记录
  278. string commandTextRecord = "INSERT INTO "
  279. + "PurOrderDT (BillNo,BillSn,EntId,BillSort,OwnerId,"
  280. + "GoodsId,PackId,Meas,AngleId,BatchCode,"
  281. + "ProduceDate,ValDate,BaseNum,Num,Price,"
  282. + "Taxprice,DedRate,Amount,Rate,Tax,"
  283. + "TaxAmount,RetailP,IsFree,RfBillNo,RfBillSn,"
  284. + "ReBillNo,ReBillSn,Remark,WHOrgId,IsDone,"
  285. + "BasePrice,BaseTaxprice,RfBillCode,ReBillCode,ExecNum,"
  286. + "CancelNum,RfRuleId,ReRuleId,unit,ContractId,"
  287. + "APID,SterilCode,K_LastInTaxP,K_Price,K_LastPrice,"
  288. + "K_IsBillClose,K_CloseStaffId,K_CloseTime,K_CloseRemark,K_Ispfsale,"
  289. + "K_PFYLSL,K_EntNuM,K_LsNum"
  290. + ")"
  291. + " VALUES (@BillNo,@BillSn,@EntId,@BillSort,@OwnerId,@"
  292. + "GoodsId,@PackId,@Meas,@AngleId,@BatchCode,@"
  293. + "ProduceDate,@ValDate,@BaseNum,@Num,@Price,@"
  294. + "Taxprice,@DedRate,@Amount,@Rate,@Tax,@"
  295. + "TaxAmount,@RetailP,@IsFree,@RfBillNo,@RfBillSn,@"
  296. + "ReBillNo,@ReBillSn,@Remark,@WHOrgId,@IsDone,@"
  297. + "BasePrice,@BaseTaxprice,@RfBillCode,@ReBillCode,@ExecNum,@"
  298. + "CancelNum,@RfRuleId,@ReRuleId,@unit,@ContractId,@"
  299. + "APID,@SterilCode,@K_LastInTaxP,@K_Price,@K_LastPrice,@"
  300. + "K_IsBillClose,@K_CloseStaffId,@K_CloseTime,@K_CloseRemark,@K_Ispfsale,@"
  301. + "K_PFYLSL,@K_EntNuM,@K_LsNum" +
  302. ")";
  303. string resultRecord;
  304. PGPrice pg = IDHelper.GetPackId(GoodsId,EntId);
  305. string GetPackId = "";
  306. if (pg!=null)
  307. GetPackId = pg.PackId;
  308. //准备参数
  309. Guid PushRecordId = Guid.NewGuid();
  310. List<List<Object>> parametersRecord = new List<List<Object>>();
  311. parametersRecord.Add(new List<Object>() { "BillNo", OrderBillNo });//关联的采购计划BillNo RandHelper.GenerateRandomCode(20)
  312. parametersRecord.Add(new List<Object>() { "BillSn", BillSn });
  313. parametersRecord.Add(new List<Object>() { "EntId", EntId });
  314. parametersRecord.Add(new List<Object>() { "BillSort", BillSn });
  315. parametersRecord.Add(new List<Object>() { "OwnerId", OrgId });
  316. parametersRecord.Add(new List<Object>() { "GoodsId", GoodsId});
  317. parametersRecord.Add(new List<Object>() { "PackId", GetPackId });
  318. parametersRecord.Add(new List<Object>() { "Meas", pg.Meas});
  319. parametersRecord.Add(new List<Object>() { "AngleId", ""});
  320. parametersRecord.Add(new List<Object>() { "BatchCode", "" });
  321. parametersRecord.Add(new List<Object>() { "ProduceDate", "" });
  322. parametersRecord.Add(new List<Object>() { "ValDate", "" });
  323. parametersRecord.Add(new List<Object>() { "BaseNum", GoodsGapNum });
  324. parametersRecord.Add(new List<Object>() { "Num", GoodsGapNum });
  325. parametersRecord.Add(new List<Object>() { "Price", LastPrice });
  326. parametersRecord.Add(new List<Object>() { "Taxprice", LastPrice });
  327. parametersRecord.Add(new List<Object>() { "DedRate", 100});
  328. decimal amount = LastPrice* GoodsGapNum;
  329. parametersRecord.Add(new List<Object>() { "Amount", amount });
  330. parametersRecord.Add(new List<Object>() { "Rate", 0});
  331. parametersRecord.Add(new List<Object>() { "Tax", 0});
  332. parametersRecord.Add(new List<Object>() { "TaxAmount", amount });
  333. parametersRecord.Add(new List<Object>() { "RetailP", 0});
  334. parametersRecord.Add(new List<Object>() { "IsFree", 'N' });
  335. parametersRecord.Add(new List<Object>() { "RfBillNo", 0});
  336. parametersRecord.Add(new List<Object>() { "RfBillSn", 0});
  337. parametersRecord.Add(new List<Object>() { "ReBillNo", PlanBillNo });
  338. parametersRecord.Add(new List<Object>() { "ReBillSn", PlanBillSn });
  339. parametersRecord.Add(new List<Object>() { "Remark", Remark});
  340. parametersRecord.Add(new List<Object>() { "WHOrgId", OrgId});
  341. parametersRecord.Add(new List<Object>() { "IsDone", 'N'});
  342. parametersRecord.Add(new List<Object>() { "BasePrice", LastPrice});
  343. parametersRecord.Add(new List<Object>() { "BaseTaxprice", LastPrice });
  344. parametersRecord.Add(new List<Object>() { "RfBillCode", ""});
  345. parametersRecord.Add(new List<Object>() { "ReBillCode", PlanBillCode });
  346. parametersRecord.Add(new List<Object>() { "ExecNum", 0});
  347. parametersRecord.Add(new List<Object>() { "CancelNum", 0});
  348. parametersRecord.Add(new List<Object>() { "RfRuleId", "" });
  349. parametersRecord.Add(new List<Object>() { "ReRuleId", "" });
  350. parametersRecord.Add(new List<Object>() { "unit", pg.unit});
  351. parametersRecord.Add(new List<Object>() { "ContractId", "" });
  352. parametersRecord.Add(new List<Object>() { "APID", "" });
  353. parametersRecord.Add(new List<Object>() { "SterilCode", "" });
  354. parametersRecord.Add(new List<Object>() { "K_LastInTaxP", 0});
  355. parametersRecord.Add(new List<Object>() { "K_Price", K_Price});
  356. parametersRecord.Add(new List<Object>() { "K_LastPrice",0 });
  357. parametersRecord.Add(new List<Object>() { "K_IsBillClose", 'N'});
  358. parametersRecord.Add(new List<Object>() { "K_CloseStaffId", ""});
  359. parametersRecord.Add(new List<Object>() { "K_CloseTime", "" });
  360. parametersRecord.Add(new List<Object>() { "K_CloseRemark", "" });
  361. parametersRecord.Add(new List<Object>() { "K_Ispfsale", 'N'});
  362. parametersRecord.Add(new List<Object>() { "K_PFYLSL", null});
  363. parametersRecord.Add(new List<Object>() { "K_EntNuM", null });
  364. parametersRecord.Add(new List<Object>() { "K_LsNum", null });
  365. List<SqlParameter> parametersRecord1 = DataAccess.ToParameters(parametersRecord);
  366. #endregion
  367. if(listcmd ==null)
  368. {
  369. int successRecord = DataAccess.ExecuteCommand(commandTextRecord, parametersRecord1, out resultRecord);
  370. resultdic.Add("successRecord", successRecord);
  371. resultdic.Add("resultRecord", resultRecord);
  372. }
  373. else
  374. {
  375. listcmd.Add(new DataAccessCommand(commandTextRecord, parametersRecord1));
  376. }
  377. return resultdic;
  378. }
  379. //IsComplete 1
  380. public static int UpdateOrderState(string FeedbackId, string RecordId,int PushAccountId,List<DataAccessCommand> listcmd)
  381. {
  382. #region 更新明细
  383. string commandTextRecord = "UPDATE " + Config.TablePrefix + "PushFeedback " +
  384. " SET HasOrder = @HasOrder ," +
  385. " State = 4, " +
  386. " ConfirmOrderTime = @ConfirmOrderTime," +
  387. " ConfirmOrderPerson = @ConfirmOrderPerson" +
  388. " WHERE Id= @FeedbackId " +
  389. " AND State = 3 " +
  390. " AND PushAccountId=" + PushAccountId;
  391. string resultRecord;
  392. //准备参数
  393. List<List<Object>> parametersRecord = new List<List<Object>>();
  394. parametersRecord.Add(new List<Object>() { "FeedbackId", Guid.Parse(FeedbackId) });
  395. parametersRecord.Add(new List<Object>() { "HasOrder", 1 });
  396. parametersRecord.Add(new List<Object>() { "ConfirmOrderTime", DateTime.Now });
  397. parametersRecord.Add(new List<Object>() { "ConfirmOrderPerson", PushAccountId });
  398. List<SqlParameter> parametersRecord1 = DataAccess.ToParameters(parametersRecord);
  399. #endregion
  400. if (listcmd == null)
  401. {
  402. int successRecord = DataAccess.ExecuteCommand(commandTextRecord, parametersRecord1, out resultRecord);
  403. if (successRecord > 0)
  404. return 1;
  405. else
  406. return 0;
  407. }
  408. else
  409. {
  410. listcmd.Add(new DataAccessCommand(commandTextRecord, parametersRecord1));
  411. return 1;
  412. }
  413. }
  414. public static int UpdateRecordOrderState(string RecordId,string LoginAccountId)
  415. {
  416. #region 更新记录
  417. string commandTextFeed = "UPDATE " + Config.TablePrefix + "PushRecord " +
  418. " SET HasOrder = @HasOrder " +
  419. //" ,OrderTime = @OrderTime," +
  420. " WHERE Id= @RecordId "
  421. // +" AND (IsComplete = 1 ) "
  422. ;
  423. string resultFeed;
  424. //准备参数
  425. List<List<Object>> parametersFeed = new List<List<Object>>();
  426. parametersFeed.Add(new List<Object>() { "RecordId", Guid.Parse(RecordId) });
  427. parametersFeed.Add(new List<Object>() { "HasOrder", 1 });
  428. //parametersFeed.Add(new List<Object>() { "OrderTime", DateTime.Now });
  429. List<SqlParameter> parametersFeed1 = DataAccess.ToParameters(parametersFeed);
  430. int successFeed = DataAccess.ExecuteCommand(commandTextFeed, parametersFeed1, out resultFeed);
  431. #endregion
  432. return successFeed;
  433. }
  434. }
  435. }