public string Stock_Add() { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); int ProID = DataConvert.CLng(Request["ProID"]); string action = DataConverter.CStr(Request.QueryString["action"]); M_Product proMod = Stock_GetProByID(mu, ProID); M_Stock stockMod = new M_Stock(); stockMod.proid = ProID; stockMod.proname = proMod.Proname; stockMod.Pronum = DataConverter.CLng(Request.Form["Pronum"]); stockMod.stocktype = DataConverter.CLng(Request.Form["stocktype_rad"]); string code = storeMod.ID + DateTime.Now.ToString("yyyyMMddHHmmss"); stockMod.danju = (stockMod.stocktype == 0 ? "RK" : "CK") + code; stockMod.UserID = mu.UserID; stockMod.adduser = mu.UserName; stockMod.StoreID = storeMod.ID; if (stockMod.Pronum < 1) { function.WriteErrMsg("出入库数量不能小于1"); return(""); } switch (stockMod.stocktype) { case 0: proMod.Stock += stockMod.Pronum; break; case 1: proMod.Stock -= stockMod.Pronum; if (proMod.Stock < 0) { function.WriteErrMsg("出库数量不能大于库存!"); return(""); } break; default: throw new Exception("出入库操作错误"); } stockBll.AddStock(stockMod); proBll.UpdateByID(proMod); if (action.Equals("addpro")) { int num = stockMod.stocktype == 0 ? stockMod.Pronum : -stockMod.Pronum; return("<script>parent.addStock(" + num + ");</script>"); } function.WriteSuccessMsg("库存操作成功", "StockList"); return(""); }
public IActionResult Stock_Add() { int ProID = DataConvert.CLng(RequestEx["ProID"]); string action = DataConverter.CStr(RequestEx["action"]); M_Product proMod = proBll.GetproductByid(ProID); M_Stock stockMod = new M_Stock(); stockMod.proid = ProID; stockMod.proname = proMod.Proname; stockMod.Pronum = DataConverter.CLng(Request.Form["Pronum"]); stockMod.stocktype = DataConverter.CLng(Request.Form["stocktype_rad"]); string code = 0 + DateTime.Now.ToString("yyyyMMddHHmmss"); stockMod.danju = (stockMod.stocktype == 0 ? "RK" : "CK") + code; stockMod.UserID = adminMod.AdminId; stockMod.adduser = adminMod.AdminName; if (stockMod.Pronum < 1) { return(WriteErr("出入库数量不能小于1")); } switch (stockMod.stocktype) { case 0: proMod.Stock += stockMod.Pronum; break; case 1: proMod.Stock -= stockMod.Pronum; if (proMod.Stock < 0) { return(WriteErr("出库数量不能大于库存!")); } break; default: throw new Exception("出入库操作错误"); } stockBll.AddStock(stockMod); proBll.UpdateByID(proMod); if (action.Equals("addpro")) { int num = stockMod.stocktype == 0 ? stockMod.Pronum : -stockMod.Pronum; return(Content("<script>parent.addStock(" + num + ");</script>")); } return(WriteOK("库存操作成功", "StockList")); }
protected void Save_B_Click(object sender, EventArgs e) { //存商品表中,这样只有显示的逻辑需要扩展,其他逻辑可不变 //商品增加筛选模型,便于扩展 M_UserInfo mu = buser.GetLogin(); M_Product proMod = proBll.GetproductByid(Mid); if (proMod == null) { proMod = new M_Product(); } proMod.Proname = Name_T.Text.Trim(); //proMod.BindIDS = UProIDS_Hid.Value; proMod.Procontent = UProIDS_Hid.Value; if (SFileUp.HasFile) { SFileUp.SaveUrl = ZLHelper.GetUploadDir_System("shop", "product", "yyyyMMdd"); proMod.Thumbnails = SFileUp.SaveFile(); } proMod.LinPrice = DataConverter.CDouble(Price_T.Text); //proMod.BookPrice = DataConverter.CDouble(BookPrice_T.Text); proMod.ShiPrice = proMod.LinPrice; //proMod.Istrue = ZStatus_Chk.Checked ? 1 : 0; proMod.Proinfo = Remind_T.Text; proMod.Nodeid = 16; proMod.ModelID = 20; proMod.GuessXML = Request.Form["GuessXML"]; proMod.UserShopID = mu.SiteID; if (proMod.ID > 0) { proBll.UpdateByID(proMod); } else { proMod.FirstNodeID = nodeBll.SelFirstNodeID(proMod.Nodeid); proMod.Class = 2; proMod.ProClass = 1; proMod.UserID = mu.UserID; proMod.AddUser = mu.UserName; proBll.Insert(proMod); } function.WriteSuccessMsg("操作成功", "SuitPro.aspx"); }
public IActionResult ShopContent() { if (ItemID < 1) { return(WriteErr("未指定商品ID")); } M_Product proMod = proBll.GetproductByid(ItemID); try { OrderCommon.ProductCheck(proMod); } catch (Exception ex) { return(WriteErr(ex.Message)); } M_ModelInfo modelinfo = modBll.SelReturnModel(proMod.ModelID); proMod.AllClickNum = proMod.AllClickNum + 1; proBll.UpdateByID(proMod); string TempNode = nodeBll.GetModelTemplate(proMod.Nodeid, proMod.ModelID); string TemplateDir = ""; if (!string.IsNullOrEmpty(proMod.ModeTemplate))//个性模板 { TemplateDir = proMod.ModeTemplate; } else if (!string.IsNullOrEmpty(TempNode)) { TemplateDir = TempNode; } else { TemplateDir = "/" + modelinfo.ContentModule; } string path = CheckTemplateUrl(TemplateDir, ref err); if (!string.IsNullOrEmpty(err)) { return(WriteErr(err)); } string Templatestr = FileSystemObject.ReadFile(path); string ContentHtml = bll.CreateHtml(Templatestr, 0, ItemID, 0); return(HtmlToClient(ContentHtml)); }
protected void RPT_ItemCommand(object source, RepeaterCommandEventArgs e) { WxAPI wxapi = WxAPI.Code_Get(); int oid = DataConvert.CLng(e.CommandArgument); M_OrderList orderMod = orderBll.SelReturnModel(oid); M_UserAPP appMod = appBll.SelModelByUid(orderMod.Userid, "wechat"); M_UserAPP appMod2 = appBll.SelModelByUid(storeMod.UserID, "wechat"); string tlpid = "dlAIEAkV0lgDfc7-RYsdLVFMyP9UF7gHi_9kjPblVAU"; switch (e.CommandName) { case "return": //确认归还 { Unbrealla.FinalOrder(orderMod); if (appMod != null && !string.IsNullOrEmpty(appMod.OpenID)) { string json = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"您已还伞成功,如需继续借伞,请扫描借伞点二维码进行借伞!\",\"color\":\"#173177\"}}"; string r = wxapi.Tlp_SendTlpMsg(appMod.OpenID, tlpid, ZoomLa.Components.SiteConfig.SiteInfo.SiteUrl + "/BU/UE/MyLend.aspx", json); } if (appMod2 != null && !string.IsNullOrEmpty(appMod2.OpenID)) { string json1 = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"用户已还伞成功!\",\"color\":\"#173177\"}}"; wxapi.Tlp_SendTlpMsg(appMod2.OpenID, tlpid, ZoomLa.Components.SiteConfig.SiteInfo.SiteUrl + "/Class_2/NodePage.aspx", json1); } //更新库存 string sql = "select * from ZL_Commodities where UserShopID=" + orderMod.StoreID; DataTable dt = SqlHelper.ExecuteTable(CommandType.Text, sql); if (dt.Rows.Count > 0) { M_Product proMod = proBll.GetproductByid(DataConvert.CLng(dt.Rows[0]["ID"])); proMod.Stock = proMod.Stock + 1; proBll.UpdateByID(proMod); } } break; case "cancel": //取消归还 { DBCenter.UpdateSQL(orderMod.TbName, "OrderStatus=0", "ID=" + oid + " AND OrderStatus=-1"); } break; case "repair": //坏伞回收 { Unbrealla.FinalOrder(orderMod); string json = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"您已还伞成功,如需继续借伞,请扫描借伞点二维码进行借伞!\",\"color\":\"#173177\"}}"; Unbrealla.SendWXNotify(appMod, tlpid, "/BU/UE/MyLend.aspx", json); json = "{\"first\": {\"value\":\"还伞成功通知\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"" + orderMod.OrderNo + "\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"" + orderMod.AddTime.ToString("yyyy年MM月dd日 HH:mm:ss") + "\",\"color\":\"#173177\"},\"keyword3\": {\"value\":\"" + orderMod.Ordersamount.ToString("0.00") + "元\",\"color\":\"#173177\"},\"remark\":{\"value\":\"用户已还伞成功,请等待公司工作人员收取坏伞!\",\"color\":\"#173177\"}}"; Unbrealla.SendWXNotify(appMod2, tlpid, "/Class_2/NodePage.aspx", json); } break; case "cancel_repair": //取消报修申请,返还余额 { double money = orderMod.Specifiedprice; orderMod.IsCount = false; orderMod.Internalrecords = ""; orderMod.Specifiedprice = 0; orderMod.OrderStatus = 0; orderBll.UpdateByID(orderMod); buser.AddMoney(orderMod.Userid, money, M_UserExpHis.SType.Purse, "取消报修,返还预扣余额[" + orderMod.id + "]"); } break; } MyBind(); }