MarketSystemMgController.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. using System;
  2. using System.Web.Mvc;
  3. using SysBaseLibs;
  4. using SysDataLibs.TableClass;
  5. using System.Text;
  6. namespace GSMarketSys.Controllers
  7. {
  8. [CheckPowerFilter]
  9. public class MarketSystemMgController : BaseController
  10. {
  11. // GET: MarketSystemMg
  12. #region 台帐登记
  13. /// <summary>
  14. /// 商品进货验收台帐页面
  15. /// </summary>
  16. /// <returns></returns>
  17. public ActionResult StockRecvLogList()
  18. {
  19. ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
  20. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  21. ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
  22. ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  23. ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
  24. //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
  25. //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
  26. return View();
  27. }
  28. /// <summary>
  29. /// 商品进货验收台帐操作
  30. /// </summary>
  31. /// <returns></returns>
  32. [HttpPost]
  33. public ActionResult StockRecvLogOper()
  34. {
  35. #region Request + new StockRecvLog_info
  36. string type = Request["Type"],
  37. id = GetRequest("ID"),
  38. sellerId = GetRequest("SellerID"),
  39. goodsName = GetRequest("GoodsName"),
  40. modelType = GetRequest("ModelType"),
  41. supplierId = GetRequest("SupplierID"),
  42. produceUnit = GetRequest("ProduceUnit"),
  43. stockTime = GetRequest("StockTime"),
  44. productCredence = GetRequest("ProductCredence"),
  45. totalCount = GetRequest("TotalCount", "INT"),
  46. tradeMark = GetRequest("TradeMark"),
  47. validTerm = GetRequest("ValidTerm"),
  48. executor = GetRequest("Executor"),
  49. notes = GetRequest("Notes"),
  50. marketId = UserSessionInfo.MarketId;
  51. if (string.IsNullOrEmpty(marketId))
  52. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  53. StockRecvLog_info stockRecvLogInfo = new StockRecvLog_info(id, UserSessionInfo.DBConn)
  54. {
  55. MarketID = marketId,
  56. SellerID=sellerId,
  57. GoodsName=goodsName,
  58. ModelType=modelType,
  59. SupplierID=supplierId,
  60. ProduceUnit=produceUnit,
  61. StockTime=stockTime,
  62. ProductCredence=productCredence,
  63. TotalCount=totalCount,
  64. TradeMark=tradeMark,
  65. ValidTerm=validTerm,
  66. Executor=executor,
  67. Notes=notes,
  68. UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  69. UserID = UserSessionInfo.UserInfo.UserID,
  70. };
  71. #endregion
  72. string lcSql = "";
  73. switch (type)
  74. {
  75. case "Add":
  76. stockRecvLogInfo.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  77. lcSql = stockRecvLogInfo.InsertSql();
  78. break;
  79. case "Edit":
  80. if (!string.IsNullOrEmpty(id))
  81. {
  82. stockRecvLogInfo.ID = id;
  83. lcSql = stockRecvLogInfo.UpdateSql();
  84. }
  85. break;
  86. case "Del":
  87. if (!string.IsNullOrEmpty(id))
  88. {
  89. stockRecvLogInfo.ID = id;
  90. lcSql = stockRecvLogInfo.DeleteSql();
  91. }
  92. break;
  93. }
  94. if (string.IsNullOrEmpty(lcSql))
  95. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  96. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  97. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  98. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  99. }
  100. /// <summary>
  101. /// 经营户经营行为信用状况记录台帐页面
  102. /// </summary>
  103. /// <returns></returns>
  104. public ActionResult SellerViolationLogList()
  105. {
  106. ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
  107. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  108. ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
  109. ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  110. ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
  111. //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
  112. //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
  113. return View();
  114. }
  115. /// <summary>
  116. /// 经营户经营行为信用状况记录台帐操作
  117. /// </summary>
  118. /// <returns></returns>
  119. [HttpPost]
  120. public ActionResult SellerViolationLogOper()
  121. {
  122. #region Request + new SellerViolationLog_info
  123. string type = Request["Type"],
  124. id = GetRequest("ID"),
  125. sellerId = GetRequest("SellerID"),
  126. minusScore = GetRequest("MinusScore", "INT"),
  127. logDate = GetRequest("LogDate"),
  128. content = GetRequest("Content"),
  129. notes = GetRequest("Notes"),
  130. marketId = UserSessionInfo.MarketId;
  131. if (string.IsNullOrEmpty(marketId))
  132. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  133. SellerViolationLog_info sellerViolationLogInfo = new SellerViolationLog_info(id, UserSessionInfo.DBConn)
  134. {
  135. MarketID = marketId,
  136. SellerID = sellerId,
  137. MinusScore=minusScore,
  138. LogDate=logDate,
  139. Content=content,
  140. Notes = notes,
  141. UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  142. UserID = UserSessionInfo.UserInfo.UserID,
  143. };
  144. #endregion
  145. string lcSql = "";
  146. switch (type)
  147. {
  148. case "Add":
  149. lcSql = sellerViolationLogInfo.InsertSql();
  150. break;
  151. case "Edit":
  152. if (!string.IsNullOrEmpty(id))
  153. {
  154. sellerViolationLogInfo.ID = id;
  155. lcSql = sellerViolationLogInfo.UpdateSql();
  156. }
  157. break;
  158. case "Del":
  159. if (!string.IsNullOrEmpty(id))
  160. {
  161. sellerViolationLogInfo.ID = id;
  162. lcSql = sellerViolationLogInfo.DeleteSql();
  163. }
  164. break;
  165. }
  166. if (string.IsNullOrEmpty(lcSql))
  167. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  168. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  169. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  170. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  171. }
  172. /// <summary>
  173. /// 猪肉/活家禽 进货台帐页面
  174. /// </summary>
  175. /// <returns></returns>
  176. public ActionResult StockupLogList(string id)
  177. {
  178. ViewBag.PageType = id;
  179. ViewBag.WinModalTitle = id == "zr" ? "猪肉" : "活家禽";
  180. ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
  181. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  182. ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
  183. ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  184. ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
  185. //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
  186. //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
  187. return View();
  188. }
  189. /// <summary>
  190. /// 猪肉/活家禽 进货台帐操作
  191. /// </summary>
  192. /// <returns></returns>
  193. [HttpPost]
  194. public ActionResult StockupLogOper(string id)
  195. {
  196. #region Request + new StockupLog_info
  197. string type = Request["Type"],
  198. id2 = GetRequest("ID2"),
  199. sellerId = GetRequest("SellerID"),
  200. supplierId = GetRequest("SupplierID"),
  201. quarantineFlag = GetRequest("QuarantineFlag"),
  202. stockDate = GetRequest("StockDate"),
  203. amount = GetRequest("Amount", "INT"),
  204. notes = GetRequest("Notes"),
  205. marketId = UserSessionInfo.MarketId;
  206. if (string.IsNullOrEmpty(marketId))
  207. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  208. StockupLog_info stockupLogInfo = new StockupLog_info(id2, UserSessionInfo.DBConn)
  209. {
  210. MarketID = marketId,
  211. SellerID = sellerId,
  212. SupplierID = supplierId,
  213. QuarantineFlag = quarantineFlag,
  214. StockDate = stockDate,
  215. Amount = amount,
  216. Type = id == "zr" ? "0" : (id == "hjq" ? "1" : ""),
  217. Notes = notes,
  218. UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  219. UserID = UserSessionInfo.UserInfo.UserID,
  220. };
  221. #endregion
  222. string lcSql = "";
  223. switch (type)
  224. {
  225. case "Add":
  226. lcSql = stockupLogInfo.InsertSql();
  227. break;
  228. case "Edit":
  229. if (!string.IsNullOrEmpty(id2))
  230. {
  231. stockupLogInfo.ID = id2;
  232. lcSql = stockupLogInfo.UpdateSql();
  233. }
  234. break;
  235. case "Del":
  236. if (!string.IsNullOrEmpty(id2))
  237. {
  238. stockupLogInfo.ID = id2;
  239. lcSql = stockupLogInfo.DeleteSql();
  240. }
  241. break;
  242. }
  243. if (string.IsNullOrEmpty(lcSql))
  244. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  245. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  246. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  247. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  248. }
  249. /// <summary>
  250. ///豆制品进货台帐页面
  251. /// </summary>
  252. /// <returns></returns>
  253. public ActionResult StockupBeanLogList()
  254. {
  255. ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
  256. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  257. ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
  258. ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  259. ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
  260. //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
  261. //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
  262. return View();
  263. }
  264. /// <summary>
  265. /// 豆制品进货台帐操作
  266. /// </summary>
  267. /// <returns></returns>
  268. [HttpPost]
  269. public ActionResult StockupBeanLogOper()
  270. {
  271. #region Request + new StockupBeanLog_info
  272. string type = Request["Type"],
  273. id = GetRequest("ID"),
  274. sellerId = GetRequest("SellerID"),
  275. supplierId = GetRequest("SupplierID"),
  276. stockDate = GetRequest("StockDate"),
  277. bdfAmount = GetRequest("BdfAmount","INT"),
  278. nzdfAmount = GetRequest("NzdfAmount","INT"),
  279. jdfAmount = GetRequest("JdfAmount","INT"),
  280. nzlpdfAmount = GetRequest("NzlpdfAmount","INT"),
  281. bgAmount = GetRequest("BgAmount","INT"),
  282. bgsAmount = GetRequest("BgsAmount","INT"),
  283. bxgAmount = GetRequest("BxgAmount","INT"),
  284. wgAmount = GetRequest("WgAmount","INT"),
  285. hxgAmount = GetRequest("HxgAmount","INT"),
  286. sjAmount = GetRequest("SjAmount","INT"),
  287. ssjAmount = GetRequest("SsjAmount","INT"),
  288. xsjAmount = GetRequest("XsjAmount","INT"),
  289. marketId = UserSessionInfo.MarketId;
  290. if (string.IsNullOrEmpty(marketId))
  291. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  292. StockupBeanLog_info stockupBeanLogInfo = new StockupBeanLog_info(id, UserSessionInfo.DBConn)
  293. {
  294. MarketID = marketId,
  295. SellerID = sellerId,
  296. SupplierID = supplierId,
  297. StockDate = stockDate,
  298. BdfAmount = bdfAmount,
  299. NzdfAmount = nzdfAmount,
  300. JdfAmount = jdfAmount,
  301. NzlpdfAmount = nzlpdfAmount,
  302. BgAmount = bgAmount,
  303. BgsAmount = bgsAmount,
  304. BxgAmount = bxgAmount,
  305. HxgAmount = hxgAmount,
  306. WgAmount = wgAmount,
  307. SjAmount = sjAmount,
  308. SsjAmount = ssjAmount,
  309. XsjAmount = xsjAmount,
  310. UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  311. UserID = UserSessionInfo.UserInfo.UserID,
  312. };
  313. #endregion
  314. string lcSql = "";
  315. switch (type)
  316. {
  317. case "Add":
  318. lcSql = stockupBeanLogInfo.InsertSql();
  319. break;
  320. case "Edit":
  321. if (!string.IsNullOrEmpty(id))
  322. {
  323. stockupBeanLogInfo.ID = id;
  324. lcSql = stockupBeanLogInfo.UpdateSql();
  325. }
  326. break;
  327. case "Del":
  328. if (!string.IsNullOrEmpty(id))
  329. {
  330. stockupBeanLogInfo.ID = id;
  331. lcSql = stockupBeanLogInfo.DeleteSql();
  332. }
  333. break;
  334. }
  335. if (string.IsNullOrEmpty(lcSql))
  336. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  337. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  338. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  339. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  340. }
  341. /// <summary>
  342. ///重要商品销售去向台帐页面
  343. /// </summary>
  344. /// <returns></returns>
  345. public ActionResult SaleDestLogList()
  346. {
  347. ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
  348. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  349. ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
  350. ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  351. ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
  352. //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
  353. //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
  354. return View();
  355. }
  356. /// <summary>
  357. /// 重要商品销售去向台帐操作
  358. /// </summary>
  359. /// <returns></returns>
  360. [HttpPost]
  361. public ActionResult SaleDestLogOper()
  362. {
  363. #region Request + new SaleDestLog_info
  364. string type = Request["Type"],
  365. id = GetRequest("ID"),
  366. sellerId = GetRequest("SellerID"),
  367. goodsName = GetRequest("GoodsName"),
  368. stockTime = GetRequest("StockTime"),
  369. tradeMark = GetRequest("TradeMark"),
  370. produceBatch = GetRequest("ProduceBatch"),
  371. modelType = GetRequest("ModelType"),
  372. destination = GetRequest("Destination"),
  373. saleCount = GetRequest("SaleCount","INT"),
  374. saleTime = GetRequest("SaleTime"),
  375. executor = GetRequest("Executor"),
  376. notes = GetRequest("Notes"),
  377. marketId = UserSessionInfo.MarketId;
  378. if (string.IsNullOrEmpty(marketId))
  379. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  380. SaleDestLog_info saleDestLogInfo = new SaleDestLog_info(id, UserSessionInfo.DBConn)
  381. {
  382. MarketID = marketId,
  383. SellerID = sellerId,
  384. GoodsName=goodsName,
  385. StockTime=stockTime,
  386. TradeMark=tradeMark,
  387. ProduceBatch=produceBatch,
  388. ModelType=modelType,
  389. Destination=destination,
  390. SaleCount=saleCount,
  391. SaleTime=saleTime,
  392. Executor=executor,
  393. Notes=notes,
  394. UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  395. UserID = UserSessionInfo.UserInfo.UserID,
  396. };
  397. #endregion
  398. string lcSql = "";
  399. switch (type)
  400. {
  401. case "Add":
  402. lcSql = saleDestLogInfo.InsertSql();
  403. break;
  404. case "Edit":
  405. if (!string.IsNullOrEmpty(id))
  406. {
  407. saleDestLogInfo.ID = id;
  408. lcSql = saleDestLogInfo.UpdateSql();
  409. }
  410. break;
  411. case "Del":
  412. if (!string.IsNullOrEmpty(id))
  413. {
  414. saleDestLogInfo.ID = id;
  415. lcSql = saleDestLogInfo.DeleteSql();
  416. }
  417. break;
  418. }
  419. if (string.IsNullOrEmpty(lcSql))
  420. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  421. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  422. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  423. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  424. }
  425. #endregion
  426. #region 先行赔偿管理
  427. /// <summary>
  428. /// 预备金缴纳页面
  429. /// </summary>
  430. /// <returns></returns>
  431. public ActionResult ReserveCompensateLogList_JN()
  432. {
  433. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  434. return View();
  435. }
  436. /// <summary>
  437. /// 预备金赔付页面
  438. /// </summary>
  439. /// <returns></returns>
  440. public ActionResult ReserveCompensateLogList_PF()
  441. {
  442. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  443. return View();
  444. }
  445. /// <summary>
  446. /// 预备金缴纳页面
  447. /// </summary>
  448. /// <returns></returns>
  449. public ActionResult ReserveCompensateLogList_BZ()
  450. {
  451. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  452. return View();
  453. }
  454. /// <summary>
  455. /// 预备金缴纳页面
  456. /// </summary>
  457. /// <returns></returns>
  458. public ActionResult ReserveCompensateLogList_TH()
  459. {
  460. ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
  461. return View();
  462. }
  463. /// <summary>
  464. /// 预备金操作
  465. /// </summary>
  466. /// <returns></returns>
  467. [HttpPost]
  468. public ActionResult ReserveCompensateLogOper(string id)
  469. {
  470. #region Request + new ReserveCompensateLog_info
  471. string type = Request["Type"],
  472. dataId = GetRequest("DataId"),
  473. sellerId = GetRequest("SellerID"),
  474. occurValue = GetRequest("OccurValue"),
  475. logDate = GetRequest("LogDate"),
  476. reason = GetRequest("Reason"),
  477. consumer = GetRequest("Consumer"),
  478. executor = GetRequest("Executor"),
  479. remark = GetRequest("Remark"),
  480. reserveChangeTypeId = "",
  481. marketId = UserSessionInfo.MarketId,
  482. preBalance = SysDataLibs.AppEnv.GetPreBalance(sellerId,marketId, UserSessionInfo.DBConn)+"";
  483. switch (id.ToUpper())
  484. {
  485. case "JN":
  486. reserveChangeTypeId = "1";
  487. break;
  488. case "PF":
  489. reserveChangeTypeId = "2";
  490. break;
  491. case "BZ":
  492. reserveChangeTypeId = "3";
  493. break;
  494. case "TH":
  495. reserveChangeTypeId = "4";
  496. break;
  497. }
  498. if (string.IsNullOrEmpty(marketId))
  499. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  500. ReserveCompensateLog_info compensateLogInfo = new ReserveCompensateLog_info(dataId, UserSessionInfo.DBConn)
  501. {
  502. MarketID = marketId,
  503. SellerID = sellerId,
  504. ReserveChangeTypeID = reserveChangeTypeId,
  505. LogDate = logDate,
  506. OccurValue = occurValue,
  507. PostBalance = "0",
  508. Remark = remark,
  509. Reason = reason,
  510. Consumer = consumer,
  511. PreBalance = preBalance,
  512. Executor = executor,
  513. UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  514. UserID = UserSessionInfo.UserInfo.UserID,
  515. };
  516. #endregion
  517. string lcSql = "";
  518. switch (type)
  519. {
  520. case "Add":
  521. compensateLogInfo.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  522. lcSql = compensateLogInfo.InsertSql();
  523. break;
  524. case "Edit":
  525. if (!string.IsNullOrEmpty(dataId))
  526. {
  527. compensateLogInfo.ID = dataId;
  528. lcSql = compensateLogInfo.UpdateSql();
  529. }
  530. break;
  531. case "Del":
  532. if (!string.IsNullOrEmpty(dataId))
  533. {
  534. compensateLogInfo.ID = dataId;
  535. lcSql = compensateLogInfo.DeleteSql();
  536. }
  537. break;
  538. }
  539. if (string.IsNullOrEmpty(lcSql))
  540. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  541. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  542. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  543. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  544. }
  545. #endregion
  546. #region 基础信息
  547. /// <summary>
  548. /// 供货商信息页面
  549. /// </summary>
  550. /// <returns></returns>
  551. public ActionResult SuppliersList()
  552. {
  553. ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, " type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
  554. return View();
  555. }
  556. /// <summary>
  557. /// 供货商信息操作
  558. /// </summary>
  559. /// <returns></returns>
  560. [HttpPost]
  561. public ActionResult SuppliersOper()
  562. {
  563. #region Request + new Suppliers_info
  564. string type = Request["Type"],
  565. id = GetRequest("ID"),
  566. habitatId = GetRequest("HabitatID"),
  567. name = GetRequest("Name"),
  568. linkman = GetRequest("Linkman"),
  569. tel = GetRequest("Tel"),
  570. address = GetRequest("Address");
  571. Suppliers_info suppliersInfo = new Suppliers_info(id, UserSessionInfo.DBConn)
  572. {
  573. Name=name,
  574. Linkman=linkman,
  575. Tel=tel,
  576. Address=address,
  577. HabitatID=habitatId,
  578. UserID = UserSessionInfo.UserInfo.UserID,
  579. };
  580. #endregion
  581. string lcSql = "";
  582. switch (type)
  583. {
  584. case "Add":
  585. lcSql = suppliersInfo.InsertSql();
  586. break;
  587. case "Edit":
  588. if (!string.IsNullOrEmpty(id))
  589. {
  590. suppliersInfo.SupplierID = id;
  591. lcSql = suppliersInfo.UpdateSql();
  592. }
  593. break;
  594. case "Del":
  595. if (!string.IsNullOrEmpty(id))
  596. {
  597. suppliersInfo.SupplierID = id;
  598. lcSql = suppliersInfo.DeleteSql();
  599. }
  600. break;
  601. }
  602. if (string.IsNullOrEmpty(lcSql))
  603. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  604. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  605. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  606. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  607. }
  608. /// <summary>
  609. /// 市场人员信息
  610. /// </summary>
  611. /// <returns></returns>
  612. public ActionResult MarketOperatorsList()
  613. {
  614. ViewBag.SelDegreeTypeInfo = GetData.Instance.GetSelStr(DegreeType_info.cDegreeTypeID, DegreeType_info.cName, Tn.DegreeType, UserSessionInfo.DBConn, false);
  615. return View();
  616. }
  617. /// <summary>
  618. /// 市场人员信息
  619. /// </summary>
  620. /// <returns></returns>
  621. [HttpPost]
  622. public ActionResult MarketOperatorsOper()
  623. {
  624. #region Request + new MarketOperators_info
  625. string type = Request["Type"],
  626. id = GetRequest("ID"),
  627. degreeTypeId = GetRequest("DegreeTypeID"),
  628. name = GetRequest("Name"),
  629. gender = GetRequest("Gender"),
  630. birthDate = GetRequest("BirthDate"),
  631. title = GetRequest("Title"),
  632. politics = GetRequest("Politics"),
  633. job = GetRequest("Job"),
  634. cellPhone = GetRequest("CellPhone"),
  635. enterCompanyDate = GetRequest("EnterCompanyDate"),
  636. tel = GetRequest("Tel"),
  637. homeAddress = GetRequest("HomeAddress"),
  638. idCard = GetRequest("IdCard"),
  639. userName = GetRequest("UserName"),
  640. notes = GetRequest("Notes"),
  641. resume = GetRequest("Resume"),
  642. family1Appellation = GetRequest("Family1Appellation"),
  643. family1Name = GetRequest("Family1Name"),
  644. family1Residence = GetRequest("Family1Residence"),
  645. family1Company = GetRequest("Family1Company"),
  646. family2Appellation = GetRequest("Family2Appellation"),
  647. family2Name = GetRequest("Family2Name"),
  648. family2Residence = GetRequest("Family2Residence"),
  649. family2Company = GetRequest("Family2Company"),
  650. family3Appellation = GetRequest("Family3Appellation"),
  651. family3Name = GetRequest("Family3Name"),
  652. family3Residence = GetRequest("Family3Residence"),
  653. family3Company = GetRequest("Family3Company"),
  654. marketId = UserSessionInfo.MarketId;
  655. if (string.IsNullOrEmpty(marketId))
  656. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  657. MarketOperators_info suppliersInfo = new MarketOperators_info(id, UserSessionInfo.DBConn)
  658. {
  659. MarketID=marketId,
  660. UserName= userName,
  661. IdCard= idCard,
  662. DegreeTypeID = degreeTypeId,
  663. Name = name,
  664. Gender = gender,
  665. BirthDate = birthDate,
  666. Title = title,
  667. Politics = politics,
  668. Job = job,
  669. CellPhone = cellPhone,
  670. EnterCompanyDate = enterCompanyDate,
  671. Tel = tel,
  672. HomeAddress = homeAddress,
  673. Notes = notes,
  674. Resume = resume,
  675. Family1Appellation = family1Appellation,
  676. Family1Name = family1Name,
  677. Family1Residence = family1Residence,
  678. Family1Company = family1Company,
  679. Family2Appellation = family2Appellation,
  680. Family2Name = family2Name,
  681. Family2Residence = family2Residence,
  682. Family2Company = family2Company,
  683. Family3Appellation = family3Appellation,
  684. Family3Name = family3Name,
  685. Family3Residence = family3Residence,
  686. Family3Company = family3Company,
  687. };
  688. #endregion
  689. string lcSql = "";
  690. switch (type)
  691. {
  692. case "Add":
  693. lcSql = suppliersInfo.InsertSql();
  694. break;
  695. case "Edit":
  696. if (!string.IsNullOrEmpty(id))
  697. {
  698. suppliersInfo.OperatorID = id;
  699. lcSql = suppliersInfo.UpdateSql();
  700. }
  701. break;
  702. case "Del":
  703. if (!string.IsNullOrEmpty(id))
  704. {
  705. suppliersInfo.OperatorID = id;
  706. lcSql = suppliersInfo.DeleteSql();
  707. }
  708. break;
  709. }
  710. if (string.IsNullOrEmpty(lcSql))
  711. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  712. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  713. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  714. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  715. }
  716. /// <summary>
  717. /// 摊位信息页面
  718. /// </summary>
  719. /// <returns></returns>
  720. public ActionResult StallsList()
  721. {
  722. return View();
  723. }
  724. /// <summary>
  725. /// 摊位信息操作
  726. /// </summary>
  727. /// <returns></returns>
  728. [HttpPost]
  729. public ActionResult StallsOper()
  730. {
  731. #region Request + new Stalls_info
  732. string type = Request["Type"],
  733. id = GetRequest("ID"),
  734. name = GetRequest("Name"),
  735. stallNo = GetRequest("StallNo"),
  736. shortName = GetRequest("ShortName"),
  737. marketId = UserSessionInfo.MarketId;
  738. if (string.IsNullOrEmpty(marketId))
  739. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  740. Stalls_info suppliersInfo = new Stalls_info(id, UserSessionInfo.DBConn)
  741. {
  742. MarketID=marketId,
  743. Name = name,
  744. StallNo=stallNo,
  745. ShortName=shortName,
  746. IsLock="N"
  747. };
  748. #endregion
  749. string lcSql = "";
  750. switch (type)
  751. {
  752. case "Add":
  753. lcSql = suppliersInfo.InsertSql();
  754. break;
  755. case "Edit":
  756. if (!string.IsNullOrEmpty(id))
  757. {
  758. suppliersInfo.StallID = id;
  759. lcSql = suppliersInfo.UpdateSql();
  760. }
  761. break;
  762. case "Del":
  763. if (!string.IsNullOrEmpty(id))
  764. {
  765. suppliersInfo.StallID = id;
  766. suppliersInfo.IsLock = "Y";
  767. lcSql = suppliersInfo.UpdateSql();
  768. }
  769. break;
  770. }
  771. if (string.IsNullOrEmpty(lcSql))
  772. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  773. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  774. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  775. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  776. }
  777. /// <summary>
  778. /// 消防设施登记 页面
  779. /// </summary>
  780. /// <returns></returns>
  781. public ActionResult FireProtect_EquipmentList()
  782. {
  783. return View();
  784. }
  785. /// <summary>
  786. /// 消防设施登记 操作
  787. /// </summary>
  788. /// <returns></returns>
  789. [HttpPost]
  790. public ActionResult FireProtect_EquipmentOper()
  791. {
  792. #region Request + new FireProtect_Equipment_info
  793. string type = Request["Type"],
  794. id = GetRequest("ID"),
  795. introduction = GetRequest("Introduction"),
  796. name = GetRequest("Name"),
  797. model = GetRequest("Model"),
  798. validTerm = GetRequest("ValidTerm"),
  799. amount = GetRequest("Amount"),
  800. marketId = UserSessionInfo.MarketId;
  801. if (string.IsNullOrEmpty(marketId))
  802. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  803. FireProtect_Equipment_info suppliersInfo = new FireProtect_Equipment_info(id, UserSessionInfo.DBConn)
  804. {
  805. MarketID = marketId,
  806. Name=name,
  807. Model=model,
  808. ValidTerm=validTerm,
  809. Amount=amount,
  810. Introduction=introduction,
  811. };
  812. #endregion
  813. string lcSql = "";
  814. switch (type)
  815. {
  816. case "Add":
  817. lcSql = suppliersInfo.InsertSql();
  818. break;
  819. case "Edit":
  820. if (!string.IsNullOrEmpty(id))
  821. {
  822. suppliersInfo.ID = id;
  823. lcSql = suppliersInfo.UpdateSql();
  824. }
  825. break;
  826. case "Del":
  827. if (!string.IsNullOrEmpty(id))
  828. {
  829. suppliersInfo.ID = id;
  830. lcSql = suppliersInfo.DeleteSql();
  831. }
  832. break;
  833. }
  834. if (string.IsNullOrEmpty(lcSql))
  835. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  836. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  837. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  838. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  839. }
  840. /// <summary>
  841. /// 消防制度登记 页面
  842. /// </summary>
  843. /// <returns></returns>
  844. public ActionResult FireProtect_SystemList()
  845. {
  846. return View();
  847. }
  848. /// <summary>
  849. /// 消防制度登记 操作
  850. /// </summary>
  851. /// <returns></returns>
  852. [HttpPost]
  853. public ActionResult FireProtect_SystemOper()
  854. {
  855. #region Request + new FireProtect_System_info
  856. string type = Request["Type"],
  857. id = GetRequest("ID"),
  858. name = GetRequest("Name"),
  859. content = GetRequest("Content"),
  860. marketId = UserSessionInfo.MarketId;
  861. if (string.IsNullOrEmpty(marketId))
  862. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  863. FireProtect_System_info suppliersInfo = new FireProtect_System_info(id, UserSessionInfo.DBConn)
  864. {
  865. MarketID = marketId,
  866. Name = name,
  867. Content=content
  868. };
  869. #endregion
  870. string lcSql = "";
  871. switch (type)
  872. {
  873. case "Add":
  874. lcSql = suppliersInfo.InsertSql();
  875. break;
  876. case "Edit":
  877. if (!string.IsNullOrEmpty(id))
  878. {
  879. suppliersInfo.Id = id;
  880. lcSql = suppliersInfo.UpdateSql();
  881. }
  882. break;
  883. case "Del":
  884. if (!string.IsNullOrEmpty(id))
  885. {
  886. suppliersInfo.Id = id;
  887. lcSql = suppliersInfo.DeleteSql();
  888. }
  889. break;
  890. }
  891. if (string.IsNullOrEmpty(lcSql))
  892. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  893. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  894. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  895. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  896. }
  897. /// <summary>
  898. /// 检测设施登记页面
  899. /// </summary>
  900. /// <returns></returns>
  901. public ActionResult MarketInspectFacilityList()
  902. {
  903. ViewBag.SelDegreeTypeInfo = GetData.Instance.GetSelStr(DegreeType_info.cDegreeTypeID, DegreeType_info.cName, Tn.DegreeType, UserSessionInfo.DBConn, false);
  904. return View();
  905. }
  906. /// <summary>
  907. /// 检测设施登记操作
  908. /// </summary>
  909. /// <returns></returns>
  910. [HttpPost]
  911. public ActionResult MarketInspectFacilityOper()
  912. {
  913. #region Request + new MarketInspectFacility_info
  914. string type = Request["Type"],
  915. id = GetRequest("ID"),
  916. roomSize = GetRequest("RoomSize","INT"),
  917. inspectorCount = GetRequest("InspectorCount", "INT"),
  918. inspectorFacility = GetRequest("InspectorFacility"),
  919. inspector1Name = GetRequest("Inspector1Name"),
  920. inspector1Gender = GetRequest("Inspector1Gender", "INT"),
  921. inspector1Age = GetRequest("Inspector1Age", "INT"),
  922. inspector1DegreeTypeId = GetRequest("Inspector1DegreeTypeID", "INT"),
  923. inspector1Tel = GetRequest("Inspector1Tel", "INT"),
  924. inspector2Name = GetRequest("Inspector2Name"),
  925. inspector2Gender = GetRequest("Inspector2Gender", "INT"),
  926. inspector2Age = GetRequest("Inspector2Age", "INT"),
  927. inspector2DegreeTypeId = GetRequest("Inspector2DegreeTypeID", "INT"),
  928. inspector2Tel = GetRequest("Inspector2Tel", "INT"),
  929. inspector3Name = GetRequest("Inspector3Name"),
  930. inspector3Gender = GetRequest("Inspector3Gender", "INT"),
  931. inspector3Age = GetRequest("Inspector3Age", "INT"),
  932. inspector3DegreeTypeId = GetRequest("Inspector3DegreeTypeID", "INT"),
  933. inspector3Tel = GetRequest("Inspector3Tel", "INT"),
  934. marketId = UserSessionInfo.MarketId;
  935. if (string.IsNullOrEmpty(marketId))
  936. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  937. MarketInspectFacility_info suppliersInfo = new MarketInspectFacility_info(id, UserSessionInfo.DBConn)
  938. {
  939. MarketID = marketId,
  940. RoomSize = roomSize,
  941. InspectorCount = inspectorCount,
  942. InspectorFacility = inspectorFacility,
  943. Inspector1Name = inspector1Name,
  944. Inspector1Gender = inspector1Gender,
  945. Inspector1Age = inspector1Age,
  946. Inspector1DegreeTypeID = inspector1DegreeTypeId,
  947. Inspector1Tel = inspector1Tel,
  948. Inspector2Name = inspector2Name,
  949. Inspector2Gender = inspector2Gender,
  950. Inspector2Age = inspector2Age,
  951. Inspector2DegreeTypeID = inspector2DegreeTypeId,
  952. Inspector2Tel = inspector2Tel,
  953. Inspector3Name = inspector3Name,
  954. Inspector3Gender = inspector3Gender,
  955. Inspector3Age = inspector3Age,
  956. Inspector3DegreeTypeID = inspector3DegreeTypeId,
  957. Inspector3Tel = inspector3Tel,
  958. };
  959. #endregion
  960. string lcSql = "";
  961. switch (type)
  962. {
  963. case "Add":
  964. lcSql = suppliersInfo.InsertSql();
  965. break;
  966. case "Edit":
  967. if (!string.IsNullOrEmpty(id))
  968. {
  969. suppliersInfo.ID = id;
  970. lcSql = suppliersInfo.UpdateSql();
  971. }
  972. break;
  973. case "Del":
  974. if (!string.IsNullOrEmpty(id))
  975. {
  976. suppliersInfo.ID = id;
  977. lcSql = suppliersInfo.DeleteSql();
  978. }
  979. break;
  980. }
  981. if (string.IsNullOrEmpty(lcSql))
  982. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  983. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  984. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  985. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  986. }
  987. #endregion
  988. #region 市场信息维护
  989. /// <summary>
  990. /// 市场信息维护页面
  991. /// </summary>
  992. /// <returns></returns>
  993. public ActionResult MarketInfo()
  994. {
  995. ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
  996. ViewBag.SelMarketTypeInfo = GetData.Instance.GetSelStr(MarketType_info.cMarketTypeID, MarketType_info.cMarketTypeName,
  997. Tn.MarketType, "MarketTypeID<>'6'", UserSessionInfo.DBConn);
  998. ViewBag.SelUpgradeInfo = GetData.Instance.GetSelStr("Upgrade", Tn.Markets, UserSessionInfo.DBConn);
  999. ViewBag.SelWarrantTypeInfo = GetData.Instance.GetSelStr("WarrantTypeID", "Name", Tn.WarrantType,
  1000. "IsLock=0 AND Flag=1", UserSessionInfo.DBConn);
  1001. return View();
  1002. }
  1003. [HttpPost]
  1004. public ActionResult GetMarketInfo()
  1005. {
  1006. string marketId = UserSessionInfo.MarketId?.Trim() ?? "";
  1007. if (string.IsNullOrEmpty(marketId))
  1008. {
  1009. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
  1010. }
  1011. string lcSql = "select * from " + Tn.Markets + " where " + Markets_info.cMarketID + " ='" + marketId + "'";
  1012. rsQuery loQuery = UserSessionInfo.DBConn.OpenQuery(lcSql);
  1013. string marketInfo="";
  1014. if (loQuery.IsOpened && loQuery.RecCount > 0)
  1015. marketInfo = loQuery.CurrentTable.ToJson("yyyy-MM-dd");
  1016. StringBuilder sb = new StringBuilder();
  1017. sb.Append("{");
  1018. sb.AppendFormat("\"Success\":true,\"State\":0,\"MarketInfo\":{0}", marketInfo);
  1019. sb.Append("}");
  1020. return Content(sb.ToString());
  1021. }
  1022. public ActionResult MarketWarrantOper()
  1023. {
  1024. #region Request + new MarketHasWarrant_info
  1025. string type = Request["Type"] ?? "",
  1026. id = GetRequest("ID"),
  1027. warrantTypeId = GetRequest("WarrantTypeID"),
  1028. //warrantStyle = GetRequest("WarrantStyle"),
  1029. warrantNumber = GetRequest("WarrantNumber"),
  1030. validStartTime = GetRequest("ValidStartTime"),
  1031. validEndTime = GetRequest("ValidEndTime"),
  1032. marketId=UserSessionInfo.MarketId?.Trim();
  1033. MarketHasWarrant_info nameBrandInfo = new MarketHasWarrant_info(id, UserSessionInfo.DBConn)
  1034. {
  1035. MarketID = marketId,
  1036. WarrantNumber = warrantNumber,
  1037. WarrantTypeID = warrantTypeId,
  1038. ValidStartTime = validStartTime,
  1039. ValidEndTime = validEndTime,
  1040. };
  1041. #endregion
  1042. string lcSql = "";
  1043. switch (type)
  1044. {
  1045. case "Add":
  1046. lcSql = nameBrandInfo.InsertSql();
  1047. break;
  1048. case "Edit":
  1049. if (!string.IsNullOrEmpty(id))
  1050. {
  1051. nameBrandInfo.ID = id;
  1052. lcSql = nameBrandInfo.UpdateSql();
  1053. }
  1054. break;
  1055. case "Del":
  1056. if (!string.IsNullOrEmpty(id))
  1057. lcSql = nameBrandInfo.DeleteSql();
  1058. break;
  1059. }
  1060. if (string.IsNullOrEmpty(lcSql))
  1061. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
  1062. if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
  1063. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
  1064. return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
  1065. }
  1066. #endregion
  1067. /// <summary>
  1068. /// 获取Requset[key]值,并ToSQL处理
  1069. /// </summary>
  1070. /// <param name="key"></param>
  1071. /// <param name="type"></param>
  1072. /// <returns></returns>
  1073. private string GetRequest(string key,string type="string")
  1074. {
  1075. string lcRetval = Request[key] ?? "";
  1076. if (type.ToLower() == "int")
  1077. lcRetval = GetData.Instance.SetIntDefault(lcRetval);
  1078. return Utils.AreaToSQLcs(lcRetval);
  1079. }
  1080. }
  1081. }