/// <summary> /// 商家注册事件 /// </summary> /// <param name="orders"></param> public static void SupplierRegister(Lebi_Supplier user) { List <PluginConfig> ps = GetPluginConfig(); foreach (PluginConfig model in ps) { foreach (PluginConfig.eventconfig cof in model.EventConfigs) { if (cof.eventname != "SupplierRegisterEvent") { continue; } try { ///Assembly assembly = Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory + "bin/" + model.Assembly + ".dll"); //Type type = assembly.GetType(cof.classname); Type type = Type.GetType("" + cof.classname + "," + cof.spacename + "", false, true); MethodInfo methodInfo = type.GetMethod(cof.methodname, new Type[] { typeof(Lebi_Supplier) }); methodInfo.Invoke(type, new object[] { user }); } catch { SystemLog.Add(model.Assembly + "对事件" + cof.eventname + "注册失败"); continue; } } } }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { LoadTheme(themecode, siteid, languagecode, pcode); if (CurrentUser.id == 0) { //未登录 if (SYS.IsAnonymousUser != "1") { Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + "")); } } if (SYS.IsSupplierCash == "1") { int sid = Rint_Para("0"); supplier = B_Lebi_Supplier.GetModel(sid); } if (supplier == null) { supplier = new Lebi_Supplier(); } CookieTool.SetCookieString("supplier", supplier.id.ToString(), 60); path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_Basket", "") + "\"><span>" + Tag("购物车") + "</span></a><em>»</em><a href=\"" + URL("P_CheckOut", "") + "\"><span>" + Tag("收银台") + "</span></a>"; basket = new Basket(); if (basket.Products.Count == 0) { Response.Redirect(URL("P_Basket", "")); } if (CurrentUser.id > 0) { cards = B_Lebi_Card.GetList("User_id=" + CurrentUser.id + " and Type_id_CardType=312 and Type_id_CardStatus in (201,203) and Time_End>'" + FormatTime(System.DateTime.Now) + "'", "id asc");//状态为已发放或部分使用 moneycards = B_Lebi_Card.GetList("User_id=" + CurrentUser.id + " and Type_id_CardType=311 and Type_id_CardStatus in (201,203) and Time_End>'" + FormatTime(System.DateTime.Now) + "'", "id asc"); } ProPerty135 = B_Lebi_ProPerty.GetList("Type_id_ProPertyType=135", "Sort desc"); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (id == 0) { if (!EX_Admin.Power("supplier_user_add", "添加商家")) { WindowNoPower(); } } else { if (!EX_Admin.Power("supplier_user_edit", "编辑商家")) { WindowNoPower(); } } model = B_Lebi_Supplier.GetModel(id); if (model == null) { model = new Lebi_Supplier(); model.Type_id_SupplierStatus = 441; user = new Lebi_User(); } else { user = B_Lebi_User.GetModel(model.User_id); } Count_pay = B_Lebi_User_Money.Counts("User_id=" + model.User_id + " and Type_id_MoneyType=198"); type = RequestTool.RequestString("type"); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_servicepanel_list", "客服面板")) { WindowNoPower(); } model = B_Lebi_Supplier.GetModel(CurrentSupplier.id); if (model == null) { model = new Lebi_Supplier(); } string con = model.ServicePanel; sp = B_ServicePanel.GetModel(con); //=================================== //这么取数据 //string con = "[{\"x\":\"111\",\"y\":\"112\".....}]"; //Shop.Model.ServicePanel sp = B_ServicePanel.GetModel(con); //这个sp里面就有你要的数据了 //例如 sp.x //保存的话,可以把以上的sp直接转化为json格式的字符串 //如 //Model.ServicePanel sp = new Model.ServicePanel(); //sp.x = ""; //sp.y = ""; //sp.theme = ""; //string json = B_ServicePanel.ToJson(sp); //===================================== }
/// <summary> /// 编辑会员密码 /// </summary> public void User_Edit_Password() { if (!EX_Admin.Power("supplier_user_edit", "编辑商家")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); string PWD1 = RequestTool.RequestString("PWD1"); string PWD2 = RequestTool.RequestString("PWD2"); MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider(); string PWD = BitConverter.ToString(hashmd5.ComputeHash(Encoding.Default.GetBytes(PWD1))).Replace("-", "").ToLower(); if (PWD1 != PWD2) { Response.Write("{\"msg\":\"两次输入的密码不一致\"}"); return; } Lebi_Supplier model = B_Lebi_Supplier.GetModel(id); model.Password = PWD; B_Lebi_Supplier.Update(model); Log.Add("编辑商家密码", "Supplier_User", id.ToString(), CurrentAdmin, model.UserName); string result = "{\"msg\":\"OK\"}"; Response.Write(result); }
public static void SupplierRegister(Lebi_Supplier user) { if (SupplierRegisterEvent != null) { SupplierRegisterEvent(user); } }
/// <summary> /// 编辑商家 /// </summary> public void Description_Edit() { if (!Power("supplier_profile", "编辑资料")) { AjaxNoPower(); return; } string UserName = RequestTool.RequestSafeString("UserName"); Lebi_Supplier model = B_Lebi_Supplier.GetModel(CurrentSupplier.id); if (model == null) { Response.Write("{\"msg\":\"账号不存在\"}"); return; } model.Name = Language.RequestSafeString("Name"); model.Description = Language.RequestStringForUserEditor("Description"); model.SEO_Title = Language.RequestSafeString("SEO_Title"); model.SEO_Keywords = Language.RequestSafeString("SEO_Keywords"); model.SEO_Description = Language.RequestSafeString("SEO_Description"); B_Lebi_Supplier.SafeBindForm(model); B_Lebi_Supplier.Update(model); Log.Add("编辑资料", "User", CurrentSupplier.id.ToString(), CurrentSupplier, model.UserName); string result = "{\"msg\":\"OK\"}"; Response.Write(result); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (!EX_Admin.Power("supplier_user_login", "商家后台维护")) { PageNoPower(); } Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(id); if (supplier == null) { PageError(); } user = B_Lebi_User.GetModel(supplier.User_id); if (user == null) { PageError(); } int AdminLogin = 1; //管理员登录标识 by Lebi.Kingdge 2017-6-23 if (EX_User.UserLogin(user.UserName, user.Password, user.DT_id, false, AdminLogin)) { string msg = ""; EX_Supplier.Login(user, "", supplier.id, out msg, 1); Response.Redirect(site.SupplierPath); } }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { LoadTheme(themecode, siteid, languagecode, pcode); site = new Site_Supplier(); backurl = RequestTool.RequestString("url").Replace("<", "").Replace(">", ""); if (backurl.ToLower().IndexOf("http") > -1 || backurl.ToLower().IndexOf("login.aspx") > -1 || backurl == "") { backurl = site.AdminPath + "/default.aspx?desk=1"; } path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">»</em><a>" + Tag("É̼Ò×¢²á") + "</a>"; verifieds = B_Lebi_Supplier_Verified.GetList("", "Sort desc"); logintype = RequestTool.RequestString("logintype", ""); List <Lebi_Supplier> suppliers = B_Lebi_Supplier.GetList("User_id=" + CurrentUser.id + "", "id desc"); if (logintype == "" && suppliers.Count > 0) { supplier = suppliers.FirstOrDefault(); Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(supplier.Supplier_Group_id); logintype = group.type; } else { foreach (Lebi_Supplier sup in suppliers) { Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(sup.Supplier_Group_id); if (logintype == group.type) { supplier = sup; } } } logintype = logintype == "" ? "supplier" : logintype; if (supplier == null) { supplier = new Lebi_Supplier(); supplier.Address = CurrentUser.Address; supplier.Area_id = CurrentUser.Area_id; supplier.Fax = CurrentUser.Fax; supplier.Email = CurrentUser.Email; supplier.MobilePhone = CurrentUser.MobilePhone; supplier.Msn = CurrentUser.Msn; supplier.Phone = CurrentUser.Phone; supplier.Postalcode = CurrentUser.Postalcode; supplier.QQ = CurrentUser.QQ; supplier.RealName = CurrentUser.RealName; supplier.UserName = CurrentUser.UserName; supplier.User_id = CurrentUser.id; status = Tag("ÐÂ×¢²á"); } else { if (supplier.Type_id_SupplierStatus == 442) { Response.Redirect(site.AdminPath + "/login.aspx"); } status = TypeName(supplier.Type_id_SupplierStatus); } }
/// <summary> /// 更新商家资金 /// </summary> /// <param name="user"></param> public static void UpdateUserMoney(Lebi_Supplier user) { string money = B_Lebi_Supplier_Money.GetValue("sum(Money)", "Supplier_id=" + user.id + " and Type_id_MoneyStatus=181"); decimal Money = 0; Decimal.TryParse(money, out Money); user.Money = Money; B_Lebi_Supplier.Update(user); }
/// <summary> /// 获得在线付款接口参数MODEL /// </summary> /// <param name="code"></param> /// <param name="order"></param> public static Lebi_OnlinePay GetOnlinePay(Lebi_Order order, string code) { if (order == null) { return(null); } string where = "Code='" + code + "'"; if (string.IsNullOrEmpty(order.KeyCode)) { if (order.IsSupplierCash == 0 && order.Language_id > 0) { where += " and ','+Language_ids+',' like '%," + order.Language_id + ",%'"; } } Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel(where); string log = ""; if (pay == null) { pay = B_Lebi_OnlinePay.GetModel("Code='" + code + "'"); } if (pay == null) { log = "在线支付接口 " + code + " 配置错误"; Log.Add(log); } else { if (order.IsSupplierCash == 1) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id); if (supplier == null) { supplier = new Lebi_Supplier(); log = "在线支付接口 " + code + " 配置错误[供应商ID:" + order.Supplier_id + "]"; Log.Add(log); return(pay); } Lebi_OnlinePay supplierpay = B_Lebi_OnlinePay.GetModel("Code='" + code + "' and Supplier_id=" + supplier.id + ""); if (supplierpay == null) { log = "在线支付接口 " + code + " 配置错误[供应商:" + supplier.SubName + ",ID:" + order.Supplier_id + "]"; Log.Add(log); return(pay); } supplierpay.TypeName = pay.TypeName; supplierpay.Url = pay.Url; supplierpay.Code = pay.Code; supplierpay.Currency_Code = pay.Currency_Code; supplierpay.Currency_id = pay.Currency_id; supplierpay.Currency_Name = pay.Currency_Name; return(supplierpay); } } return(pay); }
/// <summary> /// 获取供应商 /// </summary> /// <param name="id"></param> /// <returns></returns> public static Lebi_Supplier GetSupplier(int id) { Lebi_Supplier user = B_Lebi_Supplier.GetModel("id = " + id); if (user == null) { user = new Lebi_Supplier(); } return(user); }
public Lebi_Supplier GetSupplier(int id) { Lebi_Supplier model = B_Lebi_Supplier.GetModel(id); if (model == null) { model = new Lebi_Supplier(); } return(model); }
public string suppliername(int id) { Lebi_Supplier model = B_Lebi_Supplier.GetModel(id); if (model == null) { return(""); } return(model.SubName); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_order_edit", "编辑订单")) { NewPageNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { PageError(); return; } else { shop = CurrentSupplier; if (shop == null) { shop = new Lebi_Supplier(); } if (CurrentSupplier.id != model.Supplier_id) { PageError(); return; } } if (model.Type_id_OrderType == 212) { str = "- "; } //if (model.Type_id_OrderType == 212) // Response.Redirect("Torder_view.aspx?id=" + id); pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); Logs = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc"); torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc"); comms = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc"); langs = Language.Languages(); Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + ""); if (bill == null) { billstatus = Tag("不开发票"); } else { billstatus = Tag(EX_Type.TypeName(bill.Type_id_BillStatus)); } TransportCount = B_Lebi_Transport_Order.Counts("Order_id=" + model.id + ""); CommentCount = B_Lebi_Comment.Counts("TableName='Order' and Keyid=" + model.id + ""); LogCount = B_Lebi_Log.Counts("TableName='Order' and Keyid='" + model.id + "'"); deliveries = B_Lebi_Supplier_Delivery.GetList("Supplier_id = " + model.Supplier_id + "", "Sort desc"); DeliveryCount = B_Lebi_Supplier_Delivery.Counts("Supplier_id = " + model.Supplier_id + ""); }
//获取商家信息 public static Lebi_Supplier GetUser(int id) { Lebi_Supplier model = B_Lebi_Supplier.GetModel("id = " + id); if (model == null) { model = new Lebi_Supplier(); return(model); } return(model); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_profile", "编辑资料")) { PageReturnMsg = PageNoPowerMsg(); } int id = RequestTool.RequestInt("id", 0); model = CurrentSupplier; if (model == null) { model = new Lebi_Supplier(); } }
/// <summary> /// 商品咨询 /// </summary> /// <param name="user"></param> /// <param name="model"></param> public static void SendSMS_ask(Lebi_User user, Lebi_Comment model) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_ask")) { IsAdminSms = 1; } Lebi_Product product = B_Lebi_Product.GetModel(model.Product_id); if (product == null) { product = new Lebi_Product(); } if (product.Supplier_id > 0) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(product.Supplier_id); if (supplier.IsSupplierTransport == 0) //商家发货 { if (ShopCache.GetBaseConfig_Supplier(product.Supplier_id).SMS_sendmode.Contains("SMSTPL_ask")) { IsSupplierSms = 1; } } } if (IsAdminSms == 0 && IsSupplierSms == 0) { return; } if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string list = "" + Language.Tag("商品名称", user.Language) + ":" + Language.Content(product.Name, user.Language) + ";" + Language.Tag("内容", user.Language) + ":" + model.Content + ";"; string Admin_content = Language.Content(conf.SMSTPL_Admin_ask, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); Admin_content = Admin_content.Replace("{$Content}", list); if (IsAdminSms == 1) { Send(conf.SMS_reciveno, Admin_content); } if (IsSupplierSms == 1) { BaseConfig_Supplier config_supplier = ShopCache.GetBaseConfig_Supplier(product.Supplier_id); Send(config_supplier.SMS_reciveno, Admin_content); } }
/// <summary> /// 订单留言 /// </summary> /// <param name="user"></param> public static void SendSMS_ordercomment(Lebi_User user, Lebi_Comment model) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_Admin_ordercomment")) { IsAdminSms = 1; } Lebi_Order order = B_Lebi_Order.GetModel(model.Keyid); if (order == null) { order = new Lebi_Order(); } if (order.Supplier_id > 0) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id); if (supplier.IsSupplierTransport == 0) //商家发货 { if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_ordercomment")) { IsSupplierSms = 1; } } } if (IsAdminSms == 0 && IsSupplierSms == 0) { return; } if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string Admin_content = Language.Content(conf.SMSTPL_Admin_ordercomment, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); Admin_content = Admin_content.Replace("{$Content}", model.Content); Admin_content = Admin_content.Replace("{$OrderNO}", order.Code); if (IsAdminSms == 1) { Send(conf.SMS_reciveno, Admin_content); } if (IsSupplierSms == 1) { BaseConfig_Supplier config_supplier = ShopCache.GetBaseConfig_Supplier(order.Supplier_id); Send(config_supplier.SMS_reciveno, Admin_content); } }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("supplier_user_edit", "编辑商家")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Supplier.GetModel(id); if (model == null) { model = new Lebi_Supplier(); } }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { if (CurrentUser.id == 0) { Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + "")); } LoadTheme(themecode, siteid, languagecode, pcode); if (SYS.IsClosetuihuo == "1") { PageError(); } CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'"); path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>»</em><a href=\"" + URL("P_UserReturn", "" + id + "") + "\"><span>" + Tag("退货订单") + "</span></a><em>»</em><a href=\"" + URL("P_UserReturnApply", "") + "\"><span>" + Tag("退货申请") + "</span></a>"; CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'"); id = Rint_Para("0"); order = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + ""); if (order == null) { PageError(); } if (order.User_id != CurrentUser.id) { PageError(); } where = "Order_id=" + order.id + ""; order_products = B_Lebi_Order_Product.GetList(where, "id desc"); if (order.Supplier_id > 0) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id); if (supplier != null) { shouhuoren = supplier.RealName; shouhuodizhi = supplier.Address; shouhuodianhua = supplier.Phone; shouhuoyoubian = supplier.Postalcode; } } else { Lebi_Express_Shipper shipper = B_Lebi_Express_Shipper.GetList("", "Sort desc", 1, 1).FirstOrDefault(); if (shipper != null) { shouhuoren = shipper.UserName; shouhuodizhi = shipper.Address; shouhuodianhua = shipper.Tel; shouhuoyoubian = shipper.ZipCode; } } }
/// <summary> /// 用户这注册 /// </summary> public void User_Reg() { string url = ""; string verifycode = RequestTool.RequestString("verifycode"); if (CurrentCheckCode != verifycode) { Response.Write("{\"msg\":\"" + Tag("验证码错误") + "\"}"); return; } string UserName = RequestTool.RequestSafeString("UserName"); string PWD = RequestTool.RequestSafeString("Password"); //检查用户名存在 int count = B_Lebi_Supplier.Counts("UserName=lbsql{'" + UserName + "'}"); if (count > 0) { Response.Write("{\"msg\":\"" + Tag("用户名已注册") + "\"}"); return; } Lebi_Supplier model = new Lebi_Supplier(); B_Lebi_Supplier.SafeBindForm(model); model.Password = EX_User.MD5(PWD); model.Language = CurrentLanguage.Code; model.Time_Reg = DateTime.Now; model.Time_This = DateTime.Now; model.Time_Last = DateTime.Now; model.Count_Login = 1; model.IP_This = RequestTool.GetClientIP(); model.IP_Last = RequestTool.GetClientIP(); B_Lebi_Supplier.Add(model); //登录 EX_User.UserLogin(UserName, model.Password, GetDT(), true); ////发送邮件 //if (ShopCache.GetBaseConfig().MailSign.ToLower().Contains("zhuce")) //{ // Lebi_User user = B_Lebi_User.GetModel(B_Lebi_User.GetMaxId()); // Email.SendEmail_newuser(user); //} //url = RequestTool.RequestString("url").Replace("<", "").Replace(">", ""); //if (url.ToLower().IndexOf("http") > -1 || url.ToLower().IndexOf(URL("P_Register", "").ToLower()) > -1 || url.ToLower().IndexOf(URL("P_Login", "").ToLower()) > -1 || url == "") //{ // url = URL("P_Index", ""); //} Response.Write("{\"msg\":\"OK\"}"); }
public void LoadPage() { CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_Product'"); int id = Rint("id"); product = EX_Product.GetProduct(id); if (product.id == 0) { Response.End(); } Protype = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id); GetProWords(); supplier = B_Lebi_Supplier.GetModel(product.Supplier_id); if (supplier == null) { supplier = new Lebi_Supplier(); } product.IsSupplierTransport = supplier.IsSupplierTransport; }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("supplier_money_list", "资金明细")) { PageReturnMsg = PageNoPowerMsg(); } PageSize = RequestTool.getpageSize(25); user_id = RequestTool.RequestInt("user_id", 0); key = RequestTool.RequestString("key"); dateFrom = RequestTool.RequestString("dateFrom"); dateTo = RequestTool.RequestString("dateTo"); status = RequestTool.RequestInt("status", 0); DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom"); DateTime lbsql_dateTo = RequestTool.RequestDate("dateTo"); string where = "1=1"; if (status > 0) { where += " and Type_id_MoneyStatus=" + status + ""; } if (user_id > 0) { where += " and Supplier_id=" + user_id + ""; } if (key != "") { where += " and (Supplier_id in (select id from [Lebi_Supplier] where UserName like lbsql{'%" + key + "%'} or RealName like lbsql{'%" + key + "%'}) or Remark like lbsql{'%" + key + "%'})"; } if (dateFrom != "" && dateTo != "") { where += " and (datediff(d,Time_Add,'" + FormatDate(lbsql_dateFrom) + "')<=0 and datediff(d,Time_Add,'" + FormatDate(lbsql_dateTo) + "')>=0)"; } models = B_Lebi_Supplier_Money.GetList(where, "id desc", PageSize, page); int recordCount = B_Lebi_Supplier_Money.Counts(where); PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}&key=" + key + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&status = " + status + "&user_id = " + user_id, page, PageSize, recordCount); user = B_Lebi_Supplier.GetModel(user_id); if (user == null) { user = new Lebi_Supplier(); } }
/// <summary> /// 添加佣金记录 /// </summary> /// <param name="money"></param> /// <param name="user"></param> /// <param name="order"></param> /// <param name="type"></param> /// <param name="status"></param> /// <param name="areaid"></param> /// <param name="productid"></param> /// <param name="productparentid"></param> private void AddMoney(decimal money, Lebi_User user, int type, int areaid, int productid, int productparentid, string productnumber = "") { if (money == 0) { SystemLog.Add("金额:" + money + ",会员:" + user.id + ",订单:" + Order.Code + ""); return; } int IsSpread = 1; if (Order.Supplier_id > 0) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(Order.Supplier_id); if (supplier != null) { IsSpread = supplier.IsSpread; } } if (IsSpread == 1) //判断是否开启推广佣金 by lebi.kingdge 2015-04-10 { Lebi_Agent_Money model = new Lebi_Agent_Money(); model.Area_id = areaid; model.Money = money; model.Type_id_AgentMoneyType = type; if (Order.Type_id_OrderType == 212)//退货单 { model.Money = 0 - money; } model.Order_Code = Order.Code; model.Order_id = Order.id; model.Product_id = productid; model.Product_id_parent = productparentid; model.Type_id_AgentMoneyStatus = 381; model.Product_Number = productnumber; model.User_id = user.id; model.User_UserName = user.UserName; model.Supplier_id = Order.Supplier_id; model.DT_id = user.DT_id; B_Lebi_Agent_Money.Add(model); UpdateUserMoney(user, model); } }
/// <summary> /// 编辑商家 /// </summary> public void Profile_Edit() { if (!Power("supplier_profile", "编辑资料")) { AjaxNoPower(); return; } string UserName = RequestTool.RequestSafeString("UserName"); Lebi_Supplier model = B_Lebi_Supplier.GetModel(CurrentSupplier.id); if (model == null) { Response.Write("{\"msg\":\"账号不存在\"}"); return; } B_Lebi_Supplier.SafeBindForm(model); B_Lebi_Supplier.Update(model); Log.Add("编辑资料", "User", CurrentSupplier.id.ToString(), CurrentSupplier, model.UserName); string result = "{\"msg\":\"OK\"}"; Response.Write(result); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_skin", "编辑皮肤")) { PageReturnMsg = PageNoPowerMsg(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Supplier.GetModel("User_id = " + CurrentSupplier.User_id + ""); if (model == null) { model = new Lebi_Supplier(); } Lebi_Supplier_Skin skin = B_Lebi_Supplier_Skin.GetModel(id); if (skin != null) { model.Supplier_Skin_id = skin.id; model.head = skin.head; model.shortbar = skin.shortbar; model.longbar = skin.longbar; } }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("supplier_verified", "身份验证")) { PageReturnMsg = PageNoPowerMsg(); } PageSize = RequestTool.getpageSize(25); user_id = RequestTool.RequestInt("user_id", 0); string where = "1=1"; if (user_id > 0) { where += " and Supplier_id=" + user_id; } models = B_Lebi_Supplier_Verified_Log.GetList(where, "id desc", PageSize, page); int recordCount = B_Lebi_Supplier_Verified_Log.Counts(where); PageString = Pager.GetPaginationString("?page={0}&user_id=" + user_id, page, PageSize, recordCount); user = B_Lebi_Supplier.GetModel("id = " + user_id); if (user == null) { user = new Lebi_Supplier(); } }
/// <summary> /// 获取一个支付方式的对于供应商设置或(默认设置) /// </summary> /// <param name="pay"></param> /// <returns></returns> public Lebi_OnlinePay Getpay(Lebi_OnlinePay pay) { if (order.IsSupplierCash == 0) { return(pay); } Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id); if (supplier != null) { //供应商发货商城收款的情况 if (supplier.IsCash == 0) { return(pay); } } Lebi_OnlinePay p = B_Lebi_OnlinePay.GetModel("parentid=" + pay.id + " and Supplier_id=" + order.Supplier_id + " and IsUsed=1"); if (p != null) { if (Lang(p.Name) == "") { p.Name = pay.Name; } if (Lang(p.Description) == "") { p.Name = pay.Name; } if (p.Logo == "") { p.Logo = pay.Logo; } } return(p); }
/// <summary> /// 退货单发货 /// </summary> public void torder_shipping() { int order_id = RequestTool.RequestInt("order_id", 0); Lebi_Order model = B_Lebi_Order.GetModel("User_id=" + CurrentUser.id + " and id = " + order_id); if (model == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } if (model.IsVerified != 1) { Response.Write("{\"msg\":\"" + Tag("请等待客服人员确认") + "\"}"); return; } Lebi_Transport_Order torder = B_Lebi_Transport_Order.GetModel("Order_id=" + model.id + ""); if (torder != null) { torder.Code = RequestTool.RequestSafeString("Code"); torder.Transport_Name = RequestTool.RequestSafeString("Transport_Name"); B_Lebi_Transport_Order.Update(torder); } else { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(model.Supplier_id); if (supplier == null) { supplier = new Lebi_Supplier(); } torder = new Lebi_Transport_Order(); torder.Code = RequestTool.RequestSafeString("Code"); torder.Order_id = model.id; torder.T_Address = model.T_Address; torder.T_Email = model.T_Email; torder.T_MobilePhone = model.T_MobilePhone; torder.T_Name = model.T_Name; torder.T_Phone = model.T_Phone; //torder.Transport_Code = model.Transport_Code; //torder.Transport_id = model.Transport_id; torder.Transport_Name = RequestTool.RequestSafeString("Transport_Name"); torder.User_id = model.User_id; torder.Supplier_id = supplier.id; torder.Supplier_SubName = supplier.SubName; List <TransportProduct> tps = new List <TransportProduct>(); TransportProduct tp; List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); foreach (Lebi_Order_Product pro in pros) { tp = new TransportProduct(); tp.Count = pro.Count; tp.ImageBig = pro.ImageBig; tp.ImageMedium = pro.ImageMedium; tp.ImageOriginal = pro.ImageOriginal; tp.ImageSmall = pro.ImageSmall; tp.Product_Number = pro.Product_Number; tp.Product_id = pro.Product_id; tp.Product_Name = pro.Product_Name; tps.Add(tp); pro.Count_Shipped = pro.Count; B_Lebi_Order_Product.Update(pro); } JavaScriptSerializer jss = new JavaScriptSerializer(); torder.Product = jss.Serialize(tps); torder.Type_id_TransportOrderStatus = 220;//默认状态:在途 B_Lebi_Transport_Order.Add(torder); model.IsShipped = 1; model.IsShipped_All = 1; B_Lebi_Order.Update(model); } Response.Write("{\"msg\":\"OK\"}"); }