public static CommonReturn CheckStore(int uid) { B_Store_Info storeBll = new B_Store_Info(); if (uid < 1) { return(CommonReturn.Failed("用户未登录")); } M_Store_Info storeMod = storeBll.SelModelByUser(uid); string err = ""; if (storeMod == null || storeMod.ID < 1) { err = "店铺信息不存在"; } else if (storeMod.Status != (int)ZLEnum.ConStatus.Audited) { err = "店铺没有经过审核"; } if (!string.IsNullOrEmpty(err)) { return(CommonReturn.Failed(err)); } else { return(CommonReturn.Success(storeMod)); } }
public void Arrive_Add(M_Arrive avMod) { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); if (Mid < 1)//添加优惠券 { avMod.CUser = mu.UserID; avMod.StoreID = storeMod.ID; avMod.State = DataConvert.CLng(Request.Form["state_chk"]); int num = DataConverter.CLng(Request.Form["txtCreateNum"]); CommonReturn retMod = avBll.CreateArrive(avMod, num, "1", Request.Form["UserID_Hid"]); if (retMod.isok) { function.WriteSuccessMsg("批量添加成功!", "ArriveManage"); } else { function.WriteErrMsg(retMod.err); } } else { avMod = avBll.SelReturnModel(Mid); avMod.ArriveName = Request.Form["ArriveName"]; avMod.Amount = DataConvert.CLng(Request.Form["Amount"]); avMod.MinAmount = Convert.ToDouble(Request.Form["MinAmount"]); avMod.MaxAmount = Convert.ToDouble(Request.Form["MaxAmount"]); avMod.AgainTime = DataConvert.CDate(Request.Form["AgainTime"]); avMod.EndTime = DataConvert.CDate(Request.Form["EndTime"]); avBll.GetUpdate(avMod); function.WriteSuccessMsg("修改成功!", "ArriveManage"); } }
public int Product_OP(string ids) { string action = RequestEx["a"]; if (string.IsNullOrEmpty(ids)) { return(Failed); } switch (action) { case "order": //排序本店商品 { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); DataTable dt = JsonConvert.DeserializeObject <DataTable>(Request.Form["list"]); foreach (DataRow dr in dt.Rows) { int id = DataConvert.CLng(dr["ID"]); int orderID = DataConvert.CLng(dr["order"]); if (orderID < 0) { orderID = 0; } DBCenter.UpdateSQL("ZL_Commodities", "ComModelID=" + orderID, "ID=" + id + " AND UserShopID=" + storeMod.ID); } } break; default: proBll.setproduct(action, ids); break; } return(Success); }
//处理用户对商品的评价 public ActionResult StoreShare() { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); //筛选属于我们店,但未回复的share F_Order_Share filter = new F_Order_Share() { storeID = storeMod.ID, pid = DataConvert.CLng(Request["pid"]) }; PageSetting setting = shareBll.SelPage(CPage, PSize, filter); if (function.isAjax()) { if (filter.pid == 0) { return(PartialView("StoreShare_List", setting)); } else { //[special],仅显示店主的回复 filter.r_uid = mu.UserID; setting = shareBll.SelPage(CPage, PSize, filter); return(PartialView("StoreShare_Reply", setting)); } } else { return(View(setting)); } }
protected void Save_Btn_Click(object sender, EventArgs e) { M_UserInfo loginUser = buser.GetLogin(); M_Store_Info storeMod = storeBll.SelModelByUser(loginUser.UserID); M_UserInfo mu = null; string uname = UserName_T.Text.Trim(); string upwd = UserPwd_T.Text.Trim(); string upwd2 = UserPwd2_T.Text.Trim(); if (Mid > 0) { mu = buser.SelReturnModel(Mid); //修改密码 if (!string.IsNullOrEmpty(upwd)) { if (!upwd.Equals(upwd2)) { function.WriteErrMsg("密码与确认密码不匹配"); } mu.UserPwd = StringHelper.MD5(upwd); } } else { if (StrHelper.StrNullCheck(uname, upwd, upwd2)) { function.WriteErrMsg("用户名或密码不能为空"); } if (!upwd.Equals(upwd2)) { function.WriteErrMsg("密码与确认密码不匹配"); } if (buser.IsExistUName(uname)) { function.WriteErrMsg("用户名[" + uname + "]已存在"); } mu = buser.NewUser(uname, upwd); mu.SiteID = storeMod.ID; mu.GroupID = ExConast.EmployGroup; } mu.SiteRebateBalance = DataConvert.CDouble(SiteRebateBalance_T.Text); mu.ZnPassword = Mobile_T.Text; mu.VIP = DataConvert.CLng(Request.Form["bonus_rad"]); mu.PageID = DataConvert.CLng(Request.Form["role_rad"]); if (SFileUp.HasFile) { SFileUp.SaveUrl = ZLHelper.GetUploadDir_System("shop", "user"); mu.UserFace = SFileUp.SaveFile(); } if (mu.UserID > 0) { buser.UpdateByID(mu); } else { buser.AddModel(mu); } function.WriteSuccessMsg("操作成功", "Employee.aspx"); }
protected void Page_Load(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); if (!IsPostBack) { storeMod = new B_Store_Info().SelReturnModel(mu.SiteID); if() } }
//显示已提交归还申请的伞,可在不同的店铺归还 protected void Page_Load(object sender, EventArgs e) { mu = buser.GetLogin(); storeMod = Unbrealla.U_IsStore(mu); if (!IsPostBack) { MyBind(); } }
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 ActionResult ArriveManage() { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); PageSetting setting = avBll.SelPage(CPage, PSize, new Filter_Arrive() { storeID = storeMod.ID }); if (function.isAjax()) { return(PartialView("ArriveManage_List", setting)); } else { return(View(setting)); } }
public IActionResult ProductList() { int NodeID = DataConvert.CLng(RequestEx["NodeID"]); int filter = DataConvert.CLng(RequestEx["quicksouch"]); M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); PageSetting setting = proBll.SelPage(CPage, PSize, new Filter_Product() { storeid = storeMod.ID, NodeID = NodeID, proname = GetParam("keyword"), adduser = mu.UserName }); if (Request.IsAjaxRequest()) { return(PartialView("ProductList_List", setting)); } else { string str = ""; string ModeIDList = ""; string[] ModelID = null; if (NodeID > 0) { M_Node nod = nodeBll.GetNodeXML(NodeID); ModeIDList = nod.ContentModel; ModelID = ModeIDList.Split(','); string tlp = " <div class='btn-group'><button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown'>{0}管理<span class='caret'></span></button><ul class='dropdown-menu' role='menu'><li><a href='AddProduct?ModelID={1}&NodeID={2}'>添加{0}</a></li><li><a href='javascript:;' onclick='ShowImport();'>导入{0}</a></li></ul></div>"; if (ModelID != null) { for (int i = 0; i < ModelID.Length; i++) { M_ModelInfo model = modBll.SelReturnModel(DataConverter.CLng(ModelID[i])); if (!string.IsNullOrEmpty(model.ItemName)) { str += string.Format(tlp, model.ItemName, ModelID[i], NodeID); } } } } ViewBag.addhtml = str; return(View(setting)); } }
protected void Save_Btn_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); M_Store_Info storeMod = storeBll.SelReturnModel(mu.SiteID); M_WX_APPID appMod = appBll.SelModelByStoreId(storeMod.ID); if (appMod == null) { appMod = new M_WX_APPID(); } appMod.IsDefault = storeMod.ID; appMod.Alias = storeMod.Title; appMod.APPID = AppID_T.Text.Trim(); if (QCode_UP.HasFile) { QCode_UP.SaveFile(); appMod.QRCode = QCode_UP.FileUrl.Replace("/UploadFiles/", "");; } appMod.WxNo = WXNo_T.Text.Trim(); appMod.Secret = Secret_T.Text.Trim(); appMod.OrginID = OrginID.Text.Trim(); appMod.Pay_AccountID = Pay_Account.Text.Trim(); if (appMod.ID > 0) { appBll.UpdateByID(appMod); } else { appMod.ID = appBll.Insert(appMod); M_ModelInfo modInfo = new B_Model().SelReturnModel(50); B_Content conBll = new B_Content(); M_CommonData conMod = new M_CommonData(); conMod.NodeID = 5; conMod.ModelID = modInfo.ModelID; conMod.Title = appMod.Alias; conMod.Inputer = mu.UserName; conMod.ItemID = appMod.ID; conMod.TableName = modInfo.TableName; conBll.insert(conMod); } function.WriteSuccessMsg("操作成功"); }
private F_Order_Sale GetFilter() { F_Order_Sale filter = new F_Order_Sale(); M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); filter.stime = RequestEx["stime"]; filter.etime = RequestEx["etime"]; if (string.IsNullOrEmpty(filter.stime)) { filter.stime = DateTime.Now.AddMonths(-1).ToString("yyyy/MM/dd"); } if (string.IsNullOrEmpty(filter.etime)) { filter.etime = DateTime.Now.ToString("yyyy/MM/dd"); } filter.storeIds = storeMod.ID.ToString(); filter.fast = RequestEx["fast"]; ViewBag.storeMod = storeMod; return(filter); }
public ActionResult StockList() { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); F_Stock filter = new F_Stock() { NodeID = DataConvert.CLng(Request["NodeID"]), ProID = DataConvert.CLng(Request["ProID"]), StockType = DataConvert.CLng(Request["StockType"]), StoreID = storeMod.ID, ProName = Request["ProName"], AddUser = Request["AddUser"], SDate = Request["SDate"], EDate = Request["EDate"] }; PageSetting setting = stockBll.SelPage(CPage, PSize, filter); if (Request.IsAjaxRequest()) { return(PartialView("StockList_List", setting)); } return(View(setting)); }
public string Arrive_API() { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); string action = Request.QueryString["action"]; string ids = Request.Form["ids"]; switch (action) { case "del": //只可删除未被领取的优惠券 { if (string.IsNullOrEmpty(ids)) { return(Failed.ToString()); } SafeSC.CheckIDSEx(ids); string where = "ID IN (" + ids + ") AND StoreID=" + storeMod.ID + " AND UserID=0"; DBCenter.DelByWhere("ZL_Arrive", where); } break; case "change": if (string.IsNullOrEmpty(ids)) { return(Failed.ToString()); } SafeSC.CheckIDSEx(ids); int state = Convert.ToInt32(Request["state"]); if (state == 0) { //取消激活,只适用于已激活但未被用户领取的优惠券。 string where = "ID IN (" + ids + ") AND StoreID=" + storeMod.ID + " AND UserID=0"; DBCenter.UpdateSQL("ZL_Arrive", "State=0", where); } else { avBll.UpdateState(ids, state, storeMod.ID); } break; case "bind": int uid = Convert.ToInt32(Request["uid"]); avBll.GetUpdateUserIdByIDS(ids, uid, storeMod.ID); break; case "unbind": { //\\win10\D\Web\办酒网BAK if (string.IsNullOrEmpty(ids)) { return(Failed.ToString()); } SafeSC.CheckIDSEx(ids); avBll.GetUpdateUserIdByIDS(ids, 0, storeMod.ID); } break; default: return("[" + action + "]未命中"); } return(M_APIResult.Success.ToString()); }
protected void Page_Load(object sender, EventArgs e) { storeMod = storeBll.SelReturnModel(mu.SiteID); //M_UserInfo mu = buser.GetLogin(); //uName.Text = mu.UserName; }
protected void Page_Load(object sender, EventArgs e) { ExHelper.CheckUserAuth("cash"); mu = buser.GetLogin(); M_Store_Info storeMod = ExHelper.Store_User(); orderMod = orderBll.SelReturnModel(OrderID); client = buser.SelReturnModel(DataConvert.CLng(orderMod.Receiver)); OrderHelper.CheckIsCanPay(orderMod); if (function.isAjax()) { M_Payment payMod = payBll.CreateByOrder(orderMod); payMod.UserID = mu.UserID; payMod.CStatus = true; payMod.Status = (int)M_Payment.PayStatus.HasPayed; string result = ""; try { string type = Request.Form["type"]; switch (type) { case "money": #region 现金支付/扫码支付 { double rece = DataConvert.CDouble(Request.Form["rece"]); if (rece < payMod.MoneyPay) { throw new Exception("金额不正确,不能少于应收金额"); } payMod.Remark = string.Format("应收{0},实收{1},找零{2}", payMod.MoneyPay, rece, rece - payMod.MoneyPay); payMod.MoneyTrue = rece > payMod.MoneyPay ? payMod.MoneyPay : rece; payMod.PayPlatID = (int)M_PayPlat.Plat.Offline; //现金扫码支付 } #endregion break; case "mcard": #region 会员卡支付 { if (client.IsNull) { throw new Exception("未指定会员,无法使用会员卡支付"); } else if (client.Purse < orderMod.Ordersamount) { throw new Exception("会员卡余额不足"); } else { buser.MinusVMoney(client.UserID, orderMod.Ordersamount, M_UserExpHis.SType.Purse, "会员卡支付[" + orderMod.OrderNo + "]"); //检测会员卡余额是否充足 payMod.Remark = "会员卡支付"; payMod.MoneyTrue = orderMod.Ordersamount; payMod.PayPlatID = (int)M_PayPlat.Plat.ECPSS; //会员卡支付 } } #endregion break; default: throw new Exception("支付方式[" + type + "]不存在"); } payMod.PaymentID = payBll.Add(payMod); OrderHelper.FinalStep(payMod, orderMod, null); result = "1"; } catch (Exception ex) { ZLLog.L(ZLEnum.Log.pay, "订单:" + orderMod.id + ",原因:" + ex.Message); result = ex.Message; } if (client.UserID > 0) { DBCenter.UpdateSQL(client.TbName, "UpdateTime=getdate()", "UserID=" + client.UserID); } Response.Write(result); Response.Flush(); Response.End(); } if (!IsPostBack) { StoreName_L.Text = storeMod.Title; Cart_RPT.DataSource = cpBll.SelByOrderID(orderMod.id); Cart_RPT.DataBind(); } }
//保存 protected void EBtnSubmit_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); DataTable dt = fieldBll.GetModelFieldList(ModelID); DataTable gpdt = gpBll.GetGroupList(); DataTable table = new Call().GetDTFromPage(dt, Page, ViewState); M_Product proMod = new M_Product(); if (ProID > 0) { proMod = proBll.GetproductByid(ProID); } /*--------------proMod------------*/ proMod.Nodeid = NodeID; proMod.ModelID = ModelID; proMod.ProCode = ProCode.Text; proMod.BarCode = BarCode.Text.Trim(); proMod.Proname = Proname.Text.Trim(); proMod.Kayword = Request.Form["tabinput"]; keyBll.AddKeyWord(proMod.Kayword, 1); proMod.ProUnit = ProUnit.Text; proMod.AllClickNum = DataConverter.CLng(Request.Form["AllClickNum"]); proMod.ProClass = 1; proMod.Proinfo = Proinfo.Text; proMod.Procontent = procontent.Value; if (!string.IsNullOrEmpty(Request.Form["txt_pics"])) { try { DataTable imgdt = JsonConvert.DeserializeObject <DataTable>(Request.Form["txt_pics"]); if (imgdt.Rows.Count > 0) { proMod.Thumbnails = proMod.Clearimg = DataConvert.CStr(imgdt.Rows[0]["url"]); } } catch (Exception) { } } //proMod.Quota = DataConverter.CLng(Quota.Text); //proMod.DownQuota = DataConverter.CLng(DownQuota.Text); proMod.ShiPrice = DataConverter.CDouble(ShiPrice.Text); proMod.LinPrice = DataConverter.CDouble(LinPrice.Text); proMod.Recommend = DataConverter.CLng(Recommend_T.Text); proMod.AllClickNum = DataConverter.CLng(AllClickNum_T.Text); //更新时间,若没有指定则为当前时间 proMod.UpdateTime = DataConverter.CDate(UpdateTime.Text); proMod.AddTime = DataConverter.CDate(AddTime.Text); proMod.FirstNodeID = nodeBll.SelFirstNodeID(NodeID); proMod.UserShopID = storeMod.ID; proMod.UserType = DataConverter.CLng(Request.Form["UserPrice_Rad"]); proMod.Quota = DataConvert.CLng(Request.Form["Quota_Rad"]); proMod.DownQuota = DataConvert.CLng(Request.Form["DownQuota_Rad"]); proMod.TableName = modBll.SelReturnModel(ModelID).TableName; proMod.Sales = Sales_Chk.Checked ? 1 : 2; proMod.Istrue = istrue_chk.Checked ? 1 : 0; proMod.Ishot = ishot_chk.Checked ? 1 : 0; proMod.Isnew = isnew_chk.Checked ? 1 : 0; proMod.Isbest = isbest_chk.Checked ? 1 : 0; proMod.Allowed = 1; proMod.GuessXML = Request.Form["GuessXML"]; proMod.BindIDS = ""; string danju = proMod.UserShopID + DateTime.Now.ToString("yyyyMMddHHmmss"); if (proMod.ID < 1 || ClickType.Value.Equals("addasnew")) { proMod.AddUser = mu.UserName; proMod.Nodeid = NodeID; proMod.AddTime = DateTime.Now; proMod.UpdateTime = DateTime.Now; proMod.ID = proBll.Add(table, proMod); } else { proBll.Update(table, proMod); } Response.Redirect("ProductShow.aspx?ID=" + proMod.ID); }
public ActionResult AddProduct() { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); VM_Product vm = new VM_Product(); if (Mid < 1) { if (ModelID < 1) { function.WriteErrMsg("没有指定要添加内容的模型ID!"); return(null); } if (NodeID < 1) { function.WriteErrMsg("没有指定要添加内容的栏目节点ID!"); return(null); } vm.proMod = new M_Product() { Stock = 10, Rateset = 1, Dengji = 3 }; vm.NodeID = NodeID; vm.ModelID = ModelID; vm.proMod.ProCode = B_Product.GetProCode(); vm.ProGuid = Guid.NewGuid().ToString(); } else { vm.proMod = proBll.GetproductByid(Mid); if (vm.proMod.UserShopID != storeMod.ID) { function.WriteErrMsg("你无权修改该商品"); return(Content("")); } vm.NodeID = vm.proMod.Nodeid; vm.ModelID = vm.proMod.ModelID; vm.ValueDT = proBll.GetContent(vm.proMod.TableName, vm.proMod.ItemID); //多区域价格 vm.ProGuid = vm.proMod.ID.ToString(); vm.regionMod = regionBll.SelModelByGuid(vm.ProGuid); if (vm.regionMod == null) { vm.regionMod = new M_Shop_RegionPrice(); } //捆绑商品 if (!string.IsNullOrEmpty(vm.proMod.BindIDS)) { DataTable dt = proBll.SelByIDS(vm.proMod.BindIDS, "id,Thumbnails,Proname,LinPrice"); vm.bindList = JsonConvert.SerializeObject(dt); } #region 特选商品 { string where = string.Format("(ProIDS LIKE '%,{0},%' OR ProIDS LIKE '{0},%' OR ProIDS LIKE '%,{0}')", vm.proMod.ID.ToString()); DataTable dt = DBCenter.SelWithField("ZL_User_BindPro", "UserID", where); string uids = StrHelper.GetIDSFromDT(dt, "UserID"); ViewBag.prouids = uids; } #endregion } //------------------------------------------------------------------------------------------------ vm.nodeMod = nodeBll.SelReturnModel(vm.NodeID); if (vm.nodeMod.IsNull) { function.WriteErrMsg("节点[" + NodeID + "]不存在"); return(null); } return(View(vm)); }
public void ViewMyStore() { M_Store_Info storeMod = storeBll.SelModelByUser(mu.UserID); Response.Redirect("/Store/StoreIndex?id=" + storeMod.ID); return; }