123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170 |
- using System;
- using System.Web.Mvc;
- using SysBaseLibs;
- using SysDataLibs.TableClass;
- using System.Text;
- namespace GSMarketSys.Controllers
- {
- [CheckPowerFilter]
- public class MarketSystemMgController : BaseController
- {
- // GET: MarketSystemMg
- #region 台帐登记
- /// <summary>
- /// 商品进货验收台帐页面
- /// </summary>
- /// <returns></returns>
- public ActionResult StockRecvLogList()
- {
- ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
- ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
- //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
- //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 商品进货验收台帐操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StockRecvLogOper()
- {
- #region Request + new StockRecvLog_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- sellerId = GetRequest("SellerID"),
- goodsName = GetRequest("GoodsName"),
- modelType = GetRequest("ModelType"),
- supplierId = GetRequest("SupplierID"),
- produceUnit = GetRequest("ProduceUnit"),
- stockTime = GetRequest("StockTime"),
- productCredence = GetRequest("ProductCredence"),
- totalCount = GetRequest("TotalCount", "INT"),
- tradeMark = GetRequest("TradeMark"),
- validTerm = GetRequest("ValidTerm"),
- executor = GetRequest("Executor"),
- notes = GetRequest("Notes"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- StockRecvLog_info stockRecvLogInfo = new StockRecvLog_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- SellerID=sellerId,
- GoodsName=goodsName,
- ModelType=modelType,
- SupplierID=supplierId,
- ProduceUnit=produceUnit,
- StockTime=stockTime,
- ProductCredence=productCredence,
- TotalCount=totalCount,
- TradeMark=tradeMark,
- ValidTerm=validTerm,
- Executor=executor,
- Notes=notes,
- UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
- UserID = UserSessionInfo.UserInfo.UserID,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- stockRecvLogInfo.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- lcSql = stockRecvLogInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- stockRecvLogInfo.ID = id;
- lcSql = stockRecvLogInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- stockRecvLogInfo.ID = id;
- lcSql = stockRecvLogInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- /// 经营户经营行为信用状况记录台帐页面
- /// </summary>
- /// <returns></returns>
- public ActionResult SellerViolationLogList()
- {
- ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
- ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
- //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
- //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 经营户经营行为信用状况记录台帐操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SellerViolationLogOper()
- {
- #region Request + new SellerViolationLog_info
- string type = Request["Type"],
- id = GetRequest("ID"),
-
- sellerId = GetRequest("SellerID"),
- minusScore = GetRequest("MinusScore", "INT"),
- logDate = GetRequest("LogDate"),
- content = GetRequest("Content"),
- notes = GetRequest("Notes"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- SellerViolationLog_info sellerViolationLogInfo = new SellerViolationLog_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- SellerID = sellerId,
- MinusScore=minusScore,
- LogDate=logDate,
- Content=content,
- Notes = notes,
- UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
- UserID = UserSessionInfo.UserInfo.UserID,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = sellerViolationLogInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- sellerViolationLogInfo.ID = id;
- lcSql = sellerViolationLogInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- sellerViolationLogInfo.ID = id;
- lcSql = sellerViolationLogInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- /// 猪肉/活家禽 进货台帐页面
- /// </summary>
- /// <returns></returns>
- public ActionResult StockupLogList(string id)
- {
- ViewBag.PageType = id;
- ViewBag.WinModalTitle = id == "zr" ? "猪肉" : "活家禽";
- ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
- ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
- //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
- //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 猪肉/活家禽 进货台帐操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StockupLogOper(string id)
- {
- #region Request + new StockupLog_info
- string type = Request["Type"],
- id2 = GetRequest("ID2"),
- sellerId = GetRequest("SellerID"),
- supplierId = GetRequest("SupplierID"),
- quarantineFlag = GetRequest("QuarantineFlag"),
- stockDate = GetRequest("StockDate"),
- amount = GetRequest("Amount", "INT"),
- notes = GetRequest("Notes"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- StockupLog_info stockupLogInfo = new StockupLog_info(id2, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- SellerID = sellerId,
- SupplierID = supplierId,
- QuarantineFlag = quarantineFlag,
- StockDate = stockDate,
- Amount = amount,
- Type = id == "zr" ? "0" : (id == "hjq" ? "1" : ""),
- Notes = notes,
- UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
- UserID = UserSessionInfo.UserInfo.UserID,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = stockupLogInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id2))
- {
- stockupLogInfo.ID = id2;
- lcSql = stockupLogInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id2))
- {
- stockupLogInfo.ID = id2;
- lcSql = stockupLogInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- ///豆制品进货台帐页面
- /// </summary>
- /// <returns></returns>
- public ActionResult StockupBeanLogList()
- {
- ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
- ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
- //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
- //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 豆制品进货台帐操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StockupBeanLogOper()
- {
- #region Request + new StockupBeanLog_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- sellerId = GetRequest("SellerID"),
- supplierId = GetRequest("SupplierID"),
- stockDate = GetRequest("StockDate"),
- bdfAmount = GetRequest("BdfAmount","INT"),
- nzdfAmount = GetRequest("NzdfAmount","INT"),
- jdfAmount = GetRequest("JdfAmount","INT"),
- nzlpdfAmount = GetRequest("NzlpdfAmount","INT"),
- bgAmount = GetRequest("BgAmount","INT"),
- bgsAmount = GetRequest("BgsAmount","INT"),
- bxgAmount = GetRequest("BxgAmount","INT"),
- wgAmount = GetRequest("WgAmount","INT"),
- hxgAmount = GetRequest("HxgAmount","INT"),
- sjAmount = GetRequest("SjAmount","INT"),
- ssjAmount = GetRequest("SsjAmount","INT"),
- xsjAmount = GetRequest("XsjAmount","INT"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- StockupBeanLog_info stockupBeanLogInfo = new StockupBeanLog_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- SellerID = sellerId,
- SupplierID = supplierId,
- StockDate = stockDate,
- BdfAmount = bdfAmount,
- NzdfAmount = nzdfAmount,
- JdfAmount = jdfAmount,
- NzlpdfAmount = nzlpdfAmount,
- BgAmount = bgAmount,
- BgsAmount = bgsAmount,
- BxgAmount = bxgAmount,
- HxgAmount = hxgAmount,
- WgAmount = wgAmount,
- SjAmount = sjAmount,
- SsjAmount = ssjAmount,
- XsjAmount = xsjAmount,
- UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
- UserID = UserSessionInfo.UserInfo.UserID,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = stockupBeanLogInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- stockupBeanLogInfo.ID = id;
- lcSql = stockupBeanLogInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- stockupBeanLogInfo.ID = id;
- lcSql = stockupBeanLogInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- ///重要商品销售去向台帐页面
- /// </summary>
- /// <returns></returns>
- public ActionResult SaleDestLogList()
- {
- ViewBag.SelSuppliersInfo = GetData.Instance.GetSelStr(Suppliers_info.cSupplierID, Suppliers_info.cName, Tn.Suppliers, UserSessionInfo.DBConn, false);
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
- ViewBag.SelMarketInfo = GetData.Instance.GetSelStr(Markets_info.cMarketID, Markets_info.cNames, Tn.Markets, Markets_info.cIsLock + "='0' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, "type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
- //ViewBag.SelMajorGoodsNameInfo = GetData.Instance.GetSelStr(MajorSpecials_info.cMajorSpecialName, MajorSpecials_info.cMajorSpecialName, Tn.MajorSpecials, MajorSpecials_info.cIsLock + "='N' ", UserSessionInfo.DBConn);
- //ViewBag.SelUnitIDInfo = GetData.Instance.GetSelStr(MarketMajorQuote_info.cUnitID, Tn.MarketMajorQuote, UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 重要商品销售去向台帐操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SaleDestLogOper()
- {
- #region Request + new SaleDestLog_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- sellerId = GetRequest("SellerID"),
- goodsName = GetRequest("GoodsName"),
- stockTime = GetRequest("StockTime"),
- tradeMark = GetRequest("TradeMark"),
- produceBatch = GetRequest("ProduceBatch"),
- modelType = GetRequest("ModelType"),
- destination = GetRequest("Destination"),
- saleCount = GetRequest("SaleCount","INT"),
- saleTime = GetRequest("SaleTime"),
- executor = GetRequest("Executor"),
- notes = GetRequest("Notes"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- SaleDestLog_info saleDestLogInfo = new SaleDestLog_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- SellerID = sellerId,
- GoodsName=goodsName,
- StockTime=stockTime,
- TradeMark=tradeMark,
- ProduceBatch=produceBatch,
- ModelType=modelType,
- Destination=destination,
- SaleCount=saleCount,
- SaleTime=saleTime,
- Executor=executor,
- Notes=notes,
- UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
- UserID = UserSessionInfo.UserInfo.UserID,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = saleDestLogInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- saleDestLogInfo.ID = id;
- lcSql = saleDestLogInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- saleDestLogInfo.ID = id;
- lcSql = saleDestLogInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- #endregion
- #region 先行赔偿管理
- /// <summary>
- /// 预备金缴纳页面
- /// </summary>
- /// <returns></returns>
- public ActionResult ReserveCompensateLogList_JN()
- {
-
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 预备金赔付页面
- /// </summary>
- /// <returns></returns>
- public ActionResult ReserveCompensateLogList_PF()
- {
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 预备金缴纳页面
- /// </summary>
- /// <returns></returns>
- public ActionResult ReserveCompensateLogList_BZ()
- {
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 预备金缴纳页面
- /// </summary>
- /// <returns></returns>
- public ActionResult ReserveCompensateLogList_TH()
- {
- ViewBag.SelMarketSellersInfo = GetData.Instance.GetSelStr(MarketSellers_info.cSellerID, MarketSellers_info.cName, Tn.MarketSellers, MarketSellers_info.cIsLock + "='N' " + UserSessionInfo.MarketDataSql(true), UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 预备金操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult ReserveCompensateLogOper(string id)
- {
- #region Request + new ReserveCompensateLog_info
- string type = Request["Type"],
- dataId = GetRequest("DataId"),
- sellerId = GetRequest("SellerID"),
- occurValue = GetRequest("OccurValue"),
- logDate = GetRequest("LogDate"),
- reason = GetRequest("Reason"),
- consumer = GetRequest("Consumer"),
- executor = GetRequest("Executor"),
- remark = GetRequest("Remark"),
- reserveChangeTypeId = "",
- marketId = UserSessionInfo.MarketId,
- preBalance = SysDataLibs.AppEnv.GetPreBalance(sellerId,marketId, UserSessionInfo.DBConn)+"";
- switch (id.ToUpper())
- {
- case "JN":
- reserveChangeTypeId = "1";
- break;
- case "PF":
- reserveChangeTypeId = "2";
- break;
- case "BZ":
- reserveChangeTypeId = "3";
- break;
- case "TH":
- reserveChangeTypeId = "4";
- break;
-
- }
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- ReserveCompensateLog_info compensateLogInfo = new ReserveCompensateLog_info(dataId, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- SellerID = sellerId,
- ReserveChangeTypeID = reserveChangeTypeId,
- LogDate = logDate,
- OccurValue = occurValue,
- PostBalance = "0",
- Remark = remark,
- Reason = reason,
- Consumer = consumer,
- PreBalance = preBalance,
- Executor = executor,
- UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
- UserID = UserSessionInfo.UserInfo.UserID,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- compensateLogInfo.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
- lcSql = compensateLogInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(dataId))
- {
- compensateLogInfo.ID = dataId;
- lcSql = compensateLogInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(dataId))
- {
- compensateLogInfo.ID = dataId;
- lcSql = compensateLogInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- #endregion
- #region 基础信息
- /// <summary>
- /// 供货商信息页面
- /// </summary>
- /// <returns></returns>
- public ActionResult SuppliersList()
- {
- ViewBag.SelHabitatInfo = GetData.Instance.GetSelStr(Habitat_info.cHabitatID, Habitat_info.cNames, Tn.Habitat, " type = 1 AND islock = 0 ", UserSessionInfo.DBConn);
- return View();
- }
- /// <summary>
- /// 供货商信息操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult SuppliersOper()
- {
- #region Request + new Suppliers_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- habitatId = GetRequest("HabitatID"),
- name = GetRequest("Name"),
- linkman = GetRequest("Linkman"),
- tel = GetRequest("Tel"),
- address = GetRequest("Address");
- Suppliers_info suppliersInfo = new Suppliers_info(id, UserSessionInfo.DBConn)
- {
- Name=name,
- Linkman=linkman,
- Tel=tel,
- Address=address,
- HabitatID=habitatId,
-
- UserID = UserSessionInfo.UserInfo.UserID,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = suppliersInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.SupplierID = id;
- lcSql = suppliersInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.SupplierID = id;
- lcSql = suppliersInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- /// 市场人员信息
- /// </summary>
- /// <returns></returns>
- public ActionResult MarketOperatorsList()
- {
- ViewBag.SelDegreeTypeInfo = GetData.Instance.GetSelStr(DegreeType_info.cDegreeTypeID, DegreeType_info.cName, Tn.DegreeType, UserSessionInfo.DBConn, false);
- return View();
- }
- /// <summary>
- /// 市场人员信息
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult MarketOperatorsOper()
- {
- #region Request + new MarketOperators_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- degreeTypeId = GetRequest("DegreeTypeID"),
- name = GetRequest("Name"),
- gender = GetRequest("Gender"),
- birthDate = GetRequest("BirthDate"),
- title = GetRequest("Title"),
- politics = GetRequest("Politics"),
- job = GetRequest("Job"),
- cellPhone = GetRequest("CellPhone"),
- enterCompanyDate = GetRequest("EnterCompanyDate"),
- tel = GetRequest("Tel"),
- homeAddress = GetRequest("HomeAddress"),
- idCard = GetRequest("IdCard"),
- userName = GetRequest("UserName"),
- notes = GetRequest("Notes"),
- resume = GetRequest("Resume"),
- family1Appellation = GetRequest("Family1Appellation"),
- family1Name = GetRequest("Family1Name"),
- family1Residence = GetRequest("Family1Residence"),
- family1Company = GetRequest("Family1Company"),
- family2Appellation = GetRequest("Family2Appellation"),
- family2Name = GetRequest("Family2Name"),
- family2Residence = GetRequest("Family2Residence"),
- family2Company = GetRequest("Family2Company"),
- family3Appellation = GetRequest("Family3Appellation"),
- family3Name = GetRequest("Family3Name"),
- family3Residence = GetRequest("Family3Residence"),
- family3Company = GetRequest("Family3Company"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- MarketOperators_info suppliersInfo = new MarketOperators_info(id, UserSessionInfo.DBConn)
- {
- MarketID=marketId,
- UserName= userName,
- IdCard= idCard,
- DegreeTypeID = degreeTypeId,
- Name = name,
- Gender = gender,
- BirthDate = birthDate,
- Title = title,
- Politics = politics,
- Job = job,
- CellPhone = cellPhone,
- EnterCompanyDate = enterCompanyDate,
- Tel = tel,
- HomeAddress = homeAddress,
- Notes = notes,
- Resume = resume,
- Family1Appellation = family1Appellation,
- Family1Name = family1Name,
- Family1Residence = family1Residence,
- Family1Company = family1Company,
- Family2Appellation = family2Appellation,
- Family2Name = family2Name,
- Family2Residence = family2Residence,
- Family2Company = family2Company,
- Family3Appellation = family3Appellation,
- Family3Name = family3Name,
- Family3Residence = family3Residence,
- Family3Company = family3Company,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = suppliersInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.OperatorID = id;
- lcSql = suppliersInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.OperatorID = id;
- lcSql = suppliersInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- /// 摊位信息页面
- /// </summary>
- /// <returns></returns>
- public ActionResult StallsList()
- {
- return View();
- }
- /// <summary>
- /// 摊位信息操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StallsOper()
- {
- #region Request + new Stalls_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- name = GetRequest("Name"),
- stallNo = GetRequest("StallNo"),
- shortName = GetRequest("ShortName"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- Stalls_info suppliersInfo = new Stalls_info(id, UserSessionInfo.DBConn)
- {
- MarketID=marketId,
- Name = name,
- StallNo=stallNo,
- ShortName=shortName,
- IsLock="N"
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = suppliersInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.StallID = id;
- lcSql = suppliersInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.StallID = id;
- suppliersInfo.IsLock = "Y";
- lcSql = suppliersInfo.UpdateSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- /// 消防设施登记 页面
- /// </summary>
- /// <returns></returns>
- public ActionResult FireProtect_EquipmentList()
- {
- return View();
- }
- /// <summary>
- /// 消防设施登记 操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult FireProtect_EquipmentOper()
- {
- #region Request + new FireProtect_Equipment_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- introduction = GetRequest("Introduction"),
- name = GetRequest("Name"),
- model = GetRequest("Model"),
- validTerm = GetRequest("ValidTerm"),
- amount = GetRequest("Amount"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- FireProtect_Equipment_info suppliersInfo = new FireProtect_Equipment_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- Name=name,
- Model=model,
- ValidTerm=validTerm,
- Amount=amount,
- Introduction=introduction,
-
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = suppliersInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.ID = id;
- lcSql = suppliersInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.ID = id;
- lcSql = suppliersInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- /// 消防制度登记 页面
- /// </summary>
- /// <returns></returns>
- public ActionResult FireProtect_SystemList()
- {
- return View();
- }
- /// <summary>
- /// 消防制度登记 操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult FireProtect_SystemOper()
- {
- #region Request + new FireProtect_System_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- name = GetRequest("Name"),
- content = GetRequest("Content"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- FireProtect_System_info suppliersInfo = new FireProtect_System_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- Name = name,
- Content=content
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = suppliersInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.Id = id;
- lcSql = suppliersInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.Id = id;
- lcSql = suppliersInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- /// <summary>
- /// 检测设施登记页面
- /// </summary>
- /// <returns></returns>
- public ActionResult MarketInspectFacilityList()
- {
- ViewBag.SelDegreeTypeInfo = GetData.Instance.GetSelStr(DegreeType_info.cDegreeTypeID, DegreeType_info.cName, Tn.DegreeType, UserSessionInfo.DBConn, false);
- return View();
- }
- /// <summary>
- /// 检测设施登记操作
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult MarketInspectFacilityOper()
- {
- #region Request + new MarketInspectFacility_info
- string type = Request["Type"],
- id = GetRequest("ID"),
- roomSize = GetRequest("RoomSize","INT"),
- inspectorCount = GetRequest("InspectorCount", "INT"),
- inspectorFacility = GetRequest("InspectorFacility"),
- inspector1Name = GetRequest("Inspector1Name"),
- inspector1Gender = GetRequest("Inspector1Gender", "INT"),
- inspector1Age = GetRequest("Inspector1Age", "INT"),
- inspector1DegreeTypeId = GetRequest("Inspector1DegreeTypeID", "INT"),
- inspector1Tel = GetRequest("Inspector1Tel", "INT"),
- inspector2Name = GetRequest("Inspector2Name"),
- inspector2Gender = GetRequest("Inspector2Gender", "INT"),
- inspector2Age = GetRequest("Inspector2Age", "INT"),
- inspector2DegreeTypeId = GetRequest("Inspector2DegreeTypeID", "INT"),
- inspector2Tel = GetRequest("Inspector2Tel", "INT"),
- inspector3Name = GetRequest("Inspector3Name"),
- inspector3Gender = GetRequest("Inspector3Gender", "INT"),
- inspector3Age = GetRequest("Inspector3Age", "INT"),
- inspector3DegreeTypeId = GetRequest("Inspector3DegreeTypeID", "INT"),
- inspector3Tel = GetRequest("Inspector3Tel", "INT"),
- marketId = UserSessionInfo.MarketId;
- if (string.IsNullOrEmpty(marketId))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- MarketInspectFacility_info suppliersInfo = new MarketInspectFacility_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- RoomSize = roomSize,
- InspectorCount = inspectorCount,
- InspectorFacility = inspectorFacility,
- Inspector1Name = inspector1Name,
- Inspector1Gender = inspector1Gender,
- Inspector1Age = inspector1Age,
- Inspector1DegreeTypeID = inspector1DegreeTypeId,
- Inspector1Tel = inspector1Tel,
- Inspector2Name = inspector2Name,
- Inspector2Gender = inspector2Gender,
- Inspector2Age = inspector2Age,
- Inspector2DegreeTypeID = inspector2DegreeTypeId,
- Inspector2Tel = inspector2Tel,
- Inspector3Name = inspector3Name,
- Inspector3Gender = inspector3Gender,
- Inspector3Age = inspector3Age,
- Inspector3DegreeTypeID = inspector3DegreeTypeId,
- Inspector3Tel = inspector3Tel,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = suppliersInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.ID = id;
- lcSql = suppliersInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- {
- suppliersInfo.ID = id;
- lcSql = suppliersInfo.DeleteSql();
- }
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
- #endregion
- #region 市场信息维护
- /// <summary>
- /// 市场信息维护页面
- /// </summary>
- /// <returns></returns>
- public ActionResult MarketInfo()
- {
- ViewBag.SelRegionInfo = GetData.Instance.GetSelStr(Regions_info.cRegionID, Regions_info.cNames, Tn.Regions, UserSessionInfo.DBConn);
- ViewBag.SelMarketTypeInfo = GetData.Instance.GetSelStr(MarketType_info.cMarketTypeID, MarketType_info.cMarketTypeName,
- Tn.MarketType, "MarketTypeID<>'6'", UserSessionInfo.DBConn);
- ViewBag.SelUpgradeInfo = GetData.Instance.GetSelStr("Upgrade", Tn.Markets, UserSessionInfo.DBConn);
- ViewBag.SelWarrantTypeInfo = GetData.Instance.GetSelStr("WarrantTypeID", "Name", Tn.WarrantType,
- "IsLock=0 AND Flag=1", UserSessionInfo.DBConn);
- return View();
- }
- [HttpPost]
- public ActionResult GetMarketInfo()
- {
- string marketId = UserSessionInfo.MarketId?.Trim() ?? "";
- if (string.IsNullOrEmpty(marketId))
- {
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Auth_Error"));
- }
- string lcSql = "select * from " + Tn.Markets + " where " + Markets_info.cMarketID + " ='" + marketId + "'";
- rsQuery loQuery = UserSessionInfo.DBConn.OpenQuery(lcSql);
- string marketInfo="";
- if (loQuery.IsOpened && loQuery.RecCount > 0)
- marketInfo = loQuery.CurrentTable.ToJson("yyyy-MM-dd");
- StringBuilder sb = new StringBuilder();
- sb.Append("{");
- sb.AppendFormat("\"Success\":true,\"State\":0,\"MarketInfo\":{0}", marketInfo);
- sb.Append("}");
- return Content(sb.ToString());
- }
- public ActionResult MarketWarrantOper()
- {
- #region Request + new MarketHasWarrant_info
- string type = Request["Type"] ?? "",
- id = GetRequest("ID"),
- warrantTypeId = GetRequest("WarrantTypeID"),
- //warrantStyle = GetRequest("WarrantStyle"),
- warrantNumber = GetRequest("WarrantNumber"),
- validStartTime = GetRequest("ValidStartTime"),
- validEndTime = GetRequest("ValidEndTime"),
- marketId=UserSessionInfo.MarketId?.Trim();
- MarketHasWarrant_info nameBrandInfo = new MarketHasWarrant_info(id, UserSessionInfo.DBConn)
- {
- MarketID = marketId,
- WarrantNumber = warrantNumber,
- WarrantTypeID = warrantTypeId,
- ValidStartTime = validStartTime,
- ValidEndTime = validEndTime,
- };
- #endregion
- string lcSql = "";
- switch (type)
- {
- case "Add":
- lcSql = nameBrandInfo.InsertSql();
- break;
- case "Edit":
- if (!string.IsNullOrEmpty(id))
- {
- nameBrandInfo.ID = id;
- lcSql = nameBrandInfo.UpdateSql();
- }
- break;
- case "Del":
- if (!string.IsNullOrEmpty(id))
- lcSql = nameBrandInfo.DeleteSql();
- break;
- }
- if (string.IsNullOrEmpty(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Error"));
- if (UserSessionInfo.DBConn.ExcuteSqlTran(lcSql))
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_Success"));
- return Content(SysRebackDisplayInfo.Instance.GetDisplayValue("Oper_DBError"));
- }
-
- #endregion
- /// <summary>
- /// 获取Requset[key]值,并ToSQL处理
- /// </summary>
- /// <param name="key"></param>
- /// <param name="type"></param>
- /// <returns></returns>
- private string GetRequest(string key,string type="string")
- {
- string lcRetval = Request[key] ?? "";
- if (type.ToLower() == "int")
- lcRetval = GetData.Instance.SetIntDefault(lcRetval);
- return Utils.AreaToSQLcs(lcRetval);
- }
- }
- }
|