public bool SaveConfig(BaseConfig_Supplier model, int Supplier_id) { //return SerializationHelper.Save(model, this.xmlpath); Type type = model.GetType(); Lebi_Supplier_Config cf; foreach (System.Reflection.PropertyInfo p in type.GetProperties()) { if (p.GetValue(model, null) == null) { continue; } cf = B_Lebi_Supplier_Config.GetModel("Supplier_id = " + Supplier_id + " and Name='" + p.Name + "'"); if (cf == null) { cf = new Lebi_Supplier_Config(); cf.Name = p.Name; cf.Value = p.GetValue(model, null).ToString(); cf.Supplier_id = Supplier_id; B_Lebi_Supplier_Config.Add(cf); } else { cf.Name = p.Name; cf.Value = p.GetValue(model, null).ToString(); B_Lebi_Supplier_Config.Update(cf); } } ShopCache.SetBaseConfig(Supplier_id);//更新缓存 return(true); }
public void SMSConfig_Edit() { if (!Power("supplier_smsconfig", "手机短信设置")) { AjaxNoPower(); return; } B_BaseConfig_Supplier dob = new B_BaseConfig_Supplier(); BaseConfig_Supplier model = new BaseConfig_Supplier(); model.SMS_user = RequestTool.RequestString("SMS_user"); string pwd = RequestTool.RequestString("SMS_password"); if (pwd != "******") { model.SMS_password = pwd; } model.SMS_server = RequestTool.RequestString("SMS_server"); model.SMS_state = RequestTool.RequestString("SMS_state", "0"); model.SMS_apitype = RequestTool.RequestString("SMS_apitype"); model.SMS_sendmode = RequestTool.RequestString("SMS_sendmode"); model.SMS_reciveno = RequestTool.RequestString("SMS_reciveno"); model.SMS_serverport = RequestTool.RequestString("SMS_serverport", "20002"); model.SMS_maxlen = RequestTool.RequestString("SMS_maxlen", "0"); model.SMS_lastmsg = RequestTool.RequestString("SMS_lastmsg"); model.SMS_httpapi = RequestTool.RequestString("SMS_httpapi"); dob.SaveConfig(model, CurrentSupplier.id); Log.Add("手机短信设置", "Config", "", CurrentSupplier, ""); Response.Write("{\"msg\":\"OK\"}"); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_smsconfig", "手机短信设置")) { PageReturnMsg = PageNoPowerMsg(); } B_BaseConfig_Supplier bconfig = new B_BaseConfig_Supplier(); //model = bconfig.LoadConfig(); model = ShopCache.GetBaseConfig_Supplier(CurrentSupplier.id); SMS_password = model.SMS_password; try { if (model.SMS_server == "0" && model.SMS_state == "1") { smsClient = new SMSClient("sms.todaynic.com", Convert.ToInt32(model.SMS_serverport), model.SMS_user, model.SMS_password); account = smsClient.getBalance(); } } catch { } if (SMS_password != "") { SMS_password = "******"; } }
public static void SetBaseConfig(BaseConfig_Supplier model, int Supplier_id = 0) { CacheTool.Permanent("BaseConfig" + Supplier_id, model); //if (Shop.LebiAPI.Service.Instanse.Check("plugin_gongyingshang")) //{ // model.Plugin_gongyingshang = true; // CacheTool.Permanent("BaseConfig", model); //} }
/// <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); } }
/// <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); } }
public static BaseConfig_Supplier GetBaseConfig_Supplier(int Supplier_id) { string cacheKey = "BaseConfig" + Supplier_id; BaseConfig_Supplier model = CacheTool.Get(cacheKey) as BaseConfig_Supplier; if (model == null) { B_BaseConfig_Supplier bmodel = new B_BaseConfig_Supplier(); model = bmodel.LoadConfig(Supplier_id); model.IsMutiSite = false; SetBaseConfig(model, Supplier_id); } return(model); }
public static void SetBaseConfig(int Supplier_id = 0) { if (Supplier_id == 0) { B_BaseConfig bmodel = new B_BaseConfig(); BaseConfig model = bmodel.LoadConfig(); SetBaseConfig(model); } else { B_BaseConfig_Supplier bmodel = new B_BaseConfig_Supplier(); BaseConfig_Supplier model = bmodel.LoadConfig(Supplier_id); SetBaseConfig(model); } }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_emailconfig", "邮件设置")) { PageReturnMsg = PageNoPowerMsg(); } B_BaseConfig_Supplier bconfig = new B_BaseConfig_Supplier(); //model = bconfig.LoadConfig(); model = ShopCache.GetBaseConfig_Supplier(CurrentSupplier.id); password = model.MailPassWord; if (password != "") { password = "******"; } }
/// <summary> /// 订单收货 /// </summary> /// <param name="user"></param> /// <param name="torder"></param> public static void SendSMS_orderrecive(Lebi_User user, Lebi_Transport_Order torder) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_Admin_orderrecive")) { IsAdminSms = 1; } Lebi_Order order = B_Lebi_Order.GetModel("id=" + torder.Order_id + ""); if (order.Supplier_id > 0) { if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_orderrecive")) { 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_orderrecive, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); 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); } }
public void EmailConfig_Edit() { if (!Power("supplier_emailconfig", "邮件设置")) { AjaxNoPower(); return; } B_BaseConfig_Supplier dob = new B_BaseConfig_Supplier(); BaseConfig_Supplier model = new BaseConfig_Supplier(); model.Email = Language.RequestString("Email"); model.MailName = RequestTool.RequestString("MailName"); string pwd = RequestTool.RequestString("MailPassWord"); if (pwd != "******") { model.MailPassWord = pwd; } model.SmtpAddress = RequestTool.RequestString("SmtpAddress"); model.MailAddress = RequestTool.RequestString("MailAddress"); model.MailDisplayName = RequestTool.RequestString("MailDisplayName"); if (Convert.ToInt32(model.Mail_SendTime) < 1) { model.Mail_SendTime = "1"; } model.AdminMailAddress = RequestTool.RequestString("AdminMailAddress"); model.AdminMailSign = RequestTool.RequestString("AdminMailSign"); model.MailPort = RequestTool.RequestString("MailPort"); model.MailIsSSL = RequestTool.RequestInt("MailIsSSL").ToString(); dob.SaveConfig(model, CurrentSupplier.id); //更新队列时间 TimeWork tw = new TimeWork(); tw.work_email_restart(); Log.Add("编辑邮件设置", "Config", "", CurrentSupplier, ""); Response.Write("{\"msg\":\"OK\"}"); }
public BaseConfig_Supplier LoadConfig(int Supplier_id) { BaseConfig_Supplier model = new BaseConfig_Supplier(); //model=(BaseConfig)SerializationHelper.Load(model.GetType(), this.xmlpath); List <Lebi_Supplier_Config> models = B_Lebi_Supplier_Config.GetList("", ""); Hashtable ht = new Hashtable(); foreach (Lebi_Supplier_Config c in models) { if (ht.Contains(c.Name) == false) { ht.Add(c.Name, c.Value); } } model.BillFlag = ht["BillFlag"] == null ? "" : (string)ht["BillFlag"]; model.ClickFlag = ht["ClickFlag"] == null ? "" : (string)ht["ClickFlag"]; model.ClickNum1 = ht["ClickNum1"] == null ? "" : (string)ht["ClickNum1"]; model.ClickNum2 = ht["ClickNum2"] == null ? "" : (string)ht["ClickNum2"]; model.CommFlag = ht["CommFlag"] == null ? "" : (string)ht["CommFlag"]; model.Copyright = ht["Copyright"] == null ? "" : (string)ht["Copyright"]; model.Description = ht["Description"] == null ? "" : (string)ht["Description"]; model.Domain = ht["Domain"] == null ? "" : (string)ht["Domain"]; model.Email = ht["Email"] == null ? "" : (string)ht["Email"]; model.Filter = ht["Filter"] == null ? "" : (string)ht["Filter"]; model.HtmlFlag = ht["HtmlFlag"] == null ? "" : (string)ht["HtmlFlag"]; model.Keywords = ht["Keywords"] == null ? "" : (string)ht["Keywords"]; model.Logoimg = ht["Logoimg"] == null ? "" : (string)ht["Logoimg"]; model.Loop = ht["Loop"] == null ? "" : (string)ht["Loop"]; model.MailName = ht["MailName"] == null ? "" : (string)ht["MailName"]; model.MailSign = ht["MailSign"] == null ? "" : (string)ht["MailSign"]; model.MailPassWord = ht["MailPassWord"] == null ? "" : (string)ht["MailPassWord"]; model.MailIsSSL = ht["MailIsSSL"] == null ? "" : (string)ht["MailIsSSL"]; model.MailPort = ht["MailPort"] == null ? "" : (string)ht["MailPort"]; model.Name = ht["Name"] == null ? "" : (string)ht["Name"]; model.Openpwd = ht["Openpwd"] == null ? "" : (string)ht["Openpwd"]; model.OpenpwdFlag = ht["OpenpwdFlag"] == null ? "" : (string)ht["OpenpwdFlag"]; model.Phone = ht["Phone"] == null ? "" : (string)ht["Phone"]; model.QQ = ht["QQ"] == null ? "" : (string)ht["QQ"]; model.SalesFlag = ht["SalesFlag"] == null ? "" : (string)ht["SalesFlag"]; model.SalesNum1 = ht["SalesNum1"] == null ? "" : (string)ht["SalesNum1"]; model.SalesNum2 = ht["SalesNum2"] == null ? "" : (string)ht["SalesNum2"]; model.ServiceP = ht["ServiceP"] == null ? "" : (string)ht["ServiceP"]; model.SmtpAddress = ht["SmtpAddress"] == null ? "" : (string)ht["SmtpAddress"]; model.Tieshi = ht["Tieshi"] == null ? "" : (string)ht["Tieshi"]; model.Title = ht["Title"] == null ? "" : (string)ht["Title"]; model.UrlFlag = ht["UrlFlag"] == null ? "" : (string)ht["UrlFlag"]; model.VisitTime = ht["VisitTime"] == null ? "" : (string)ht["VisitTime"]; model.VisitTimeFlag = ht["VisitTimeFlag"] == null ? "" : (string)ht["VisitTimeFlag"]; model.WeiHuFlag = ht["WeiHuFlag"] == null ? "" : (string)ht["WeiHuFlag"]; model.Wornings = ht["Wornings"] == null ? "" : (string)ht["Wornings"]; model.ServicePanel = ht["ServicePanel"] == null ? "" : (string)ht["ServicePanel"]; model.KuaiDi100 = ht["KuaiDi100"] == null ? "" : (string)ht["KuaiDi100"]; model.KuaiDi100Status = ht["KuaiDi100Status"] == null ? "" : (string)ht["KuaiDi100Status"]; model.EmailTPL_getpwd = ht["EmailTPL_getpwd"] == null ? "" : (string)ht["EmailTPL_getpwd"]; model.EmailTPL_newuser = ht["EmailTPL_newuser"] == null ? "" : (string)ht["EmailTPL_newuser"]; model.EmailTPL_ordershipping = ht["EmailTPL_ordershipping"] == null ? "" : (string)ht["EmailTPL_ordershipping"]; model.EmailTPL_ordersubmit = ht["EmailTPL_ordersubmit"] == null ? "" : (string)ht["EmailTPL_ordersubmit"]; model.SMSTPL_orderpickup = ht["SMSTPL_orderpickup"] == null ? "" : (string)ht["SMSTPL_orderpickup"]; model.EmailTPL_getpwd_title = ht["EmailTPL_getpwd_title"] == null ? "" : (string)ht["EmailTPL_getpwd_title"]; model.EmailTPL_newuser_title = ht["EmailTPL_newuser_title"] == null ? "" : (string)ht["EmailTPL_newuser_title"]; model.EmailTPL_ordershipping_title = ht["EmailTPL_ordershipping_title"] == null ? "" : (string)ht["EmailTPL_ordershipping_title"]; model.EmailTPL_ordersubmit_title = ht["EmailTPL_ordersubmit_title"] == null ? "" : (string)ht["EmailTPL_ordersubmit_title"]; model.AdminMailAddress = ht["AdminMailAddress"] == null ? "" : (string)ht["AdminMailAddress"]; model.AdminMailSign = ht["AdminMailSign"] == null ? "" : (string)ht["AdminMailSign"]; model.EmailTPL_Admin_newuser = ht["EmailTPL_Admin_newuser"] == null ? "" : (string)ht["EmailTPL_Admin_newuser"]; model.EmailTPL_Admin_ordersubmit = ht["EmailTPL_Admin_ordersubmit"] == null ? "" : (string)ht["EmailTPL_Admin_ordersubmit"]; model.EmailTPL_Admin_ordercomment = ht["EmailTPL_Admin_ordercomment"] == null ? "" : (string)ht["EmailTPL_Admin_ordercomment"]; model.EmailTPL_Admin_inquiry = ht["EmailTPL_Admin_inquiry"] == null ? "" : (string)ht["EmailTPL_Admin_inquiry"]; model.EmailTPL_Admin_comment = ht["EmailTPL_Admin_comment"] == null ? "" : (string)ht["EmailTPL_Admin_comment"]; model.EmailTPL_Admin_ask = ht["EmailTPL_Admin_ask"] == null ? "" : (string)ht["EmailTPL_Admin_ask"]; model.EmailTPL_Admin_message = ht["EmailTPL_Admin_message"] == null ? "" : (string)ht["EmailTPL_Admin_message"]; model.EmailTPL_Admin_newuser_title = ht["EmailTPL_Admin_newuser_title"] == null ? "" : (string)ht["EmailTPL_Admin_newuser_title"]; model.EmailTPL_Admin_ordersubmit_title = ht["EmailTPL_Admin_ordersubmit_title"] == null ? "" : (string)ht["EmailTPL_Admin_ordersubmit_title"]; model.EmailTPL_Admin_ordercomment_title = ht["EmailTPL_Admin_ordercomment_title"] == null ? "" : (string)ht["EmailTPL_Admin_ordercomment_title"]; model.EmailTPL_Admin_inquiry_title = ht["EmailTPL_Admin_inquiry_title"] == null ? "" : (string)ht["EmailTPL_Admin_inquiry_title"]; model.EmailTPL_Admin_comment_title = ht["EmailTPL_Admin_comment_title"] == null ? "" : (string)ht["EmailTPL_Admin_comment_title"]; model.EmailTPL_Admin_ask_title = ht["EmailTPL_Admin_ask_title"] == null ? "" : (string)ht["EmailTPL_Admin_ask_title"]; model.EmailTPL_Admin_message_title = ht["EmailTPL_Admin_message_title"] == null ? "" : (string)ht["EmailTPL_Admin_message_title"]; model.EmailTPL_changgouqingdan = ht["EmailTPL_changgouqingdan"] == null ? "" : (string)ht["EmailTPL_changgouqingdan"]; model.EmailTPL_changgouqingdan_title = ht["EmailTPL_changgouqingdan_title"] == null ? "" : (string)ht["EmailTPL_changgouqingdan_title"]; model.EmailTPL_checkcode = ht["EmailTPL_checkcode"] == null ? "" : (string)ht["EmailTPL_checkcode"]; model.EmailTPL_checkcode_title = ht["EmailTPL_checkcode_title"] == null ? "" : (string)ht["EmailTPL_checkcode_title"]; model.EmailTPL_sendfriend = ht["EmailTPL_sendfriend"] == null ? "" : (string)ht["EmailTPL_sendfriend"]; model.EmailTPL_sendfriend_title = ht["EmailTPL_sendfriend_title"] == null ? "" : (string)ht["EmailTPL_sendfriend_title"]; model.EmailTPL_reserveok = ht["EmailTPL_reserveok"] == null ? "" : (string)ht["EmailTPL_reserveok"]; model.EmailTPL_reserveok_title = ht["EmailTPL_reserveok_title"] == null ? "" : (string)ht["EmailTPL_reserveok_title"]; model.SMSTPL_Admin_orderpaid = ht["SMSTPL_Admin_orderpaid"] == null ? "" : (string)ht["SMSTPL_Admin_orderpaid"]; model.MailAddress = ht["MailAddress"] == null ? "" : (string)ht["MailAddress"]; model.MailDisplayName = ht["MailDisplayName"] == null ? "" : (string)ht["MailDisplayName"]; model.DataBase_BackPath = ht["DataBase_BackPath"] == null ? "" : (string)ht["DataBase_BackPath"]; model.DataBase_BackName = ht["DataBase_BackName"] == null ? "" : (string)ht["DataBase_BackName"]; model.Mail_SendTop = ht["Mail_SendTop"] == null ? "" : (string)ht["Mail_SendTop"]; model.Mail_SendTime = ht["Mail_SendTime"] == null ? "" : (string)ht["Mail_SendTime"]; model.DataBase_BackUpTime = ht["DataBase_BackUpTime"] == null ? "" : (string)ht["DataBase_BackUpTime"]; model.CommentPoint = ht["CommentPoint"] == null ? "" : (string)ht["CommentPoint"]; model.IsBasketAction = ht["IsBasketAction"] == null ? "0" : (string)ht["IsBasketAction"]; model.ProductNumberPrefix = ht["ProductNumberPrefix"] == null ? "" : (string)ht["ProductNumberPrefix"]; model.ProductNumberLength = ht["ProductNumberLength"] == null ? "8" : (string)ht["ProductNumberLength"]; model.NewEventTimes = ht["NewEventTimes"] == null ? "60000" : (string)ht["NewEventTimes"]; model.NewEventPlayAudio = ht["NewEventPlayAudio"] == null ? "1" : (string)ht["NewEventPlayAudio"]; //授权 model.LicenseMD5 = (string)ht["LicenseMD5"]; model.LicensePWD = (string)ht["LicensePWD"]; model.LicenseDomain = (string)ht["LicenseDomain"]; model.LicenseString = (string)ht["LicenseString"]; model.LicensePackage = (string)ht["LicensePackage"]; model.LicenseUserName = (string)ht["LicenseUserName"]; model.Version = (string)ht["Version"]; model.Version_Son = (string)ht["Version_Son"]; model.UpLoadLimit = ht["UpLoadLimit"] == null ? "2" : (string)ht["UpLoadLimit"]; //默认2M model.UpLoadPath = ht["UpLoadPath"] == null ? "/upload" : (string)ht["UpLoadPath"]; //默认/upload model.UpLoadSaveName = ht["UpLoadSaveName"] == null ? "0" : (string)ht["UpLoadSaveName"]; model.UpLoadRName = (string)ht["UpLoadRName"]; model.UpLoadMode = ht["UpLoadMode"] == null ? "0" : (string)ht["UpLoadMode"]; model.IPLock = ht["IPLock"] == null ? "" : (string)ht["IPLock"]; model.InstallCode = ht["InstallCode"] == null ? "" : (string)ht["InstallCode"]; model.SpreadCode = ht["SpreadCode"] == null ? "" : (string)ht["SpreadCode"]; //第三方登录 model.platform_login = ht["platform_login"] == null ? "" : (string)ht["platform_login"]; model.platform_qq_id = ht["platform_qq_id"] == null ? "" : (string)ht["platform_qq_id"]; model.platform_qq_key = ht["platform_qq_key"] == null ? "" : (string)ht["platform_qq_key"]; model.platform_qq_image = ht["platform_qq_image"] == null ? "" : (string)ht["platform_qq_image"]; model.platform_weibo_id = ht["platform_weibo_id"] == null ? "" : (string)ht["platform_weibo_id"]; model.platform_weibo_key = ht["platform_weibo_key"] == null ? "" : (string)ht["platform_weibo_key"]; model.platform_weibo_image = ht["platform_weibo_image"] == null ? "" : (string)ht["platform_weibo_image"]; model.platform_taobao_image = ht["platform_taobao_image"] == null ? "" : (string)ht["platform_taobao_image"]; model.platform_taobao_key = ht["platform_taobao_key"] == null ? "" : (string)ht["platform_taobao_key"]; model.platform_taobao_secret = ht["platform_taobao_secret"] == null ? "" : (string)ht["platform_taobao_secret"]; model.platform_facebook_secret = ht["platform_facebook_secret"] == null ? "" : (string)ht["platform_facebook_secret"]; model.platform_facebook_id = ht["platform_facebook_id"] == null ? "" : (string)ht["platform_facebook_id"]; model.platform_facebook_image = ht["platform_facebook_image"] == null ? "" : (string)ht["platform_facebook_image"]; model.platform_twitter_image = ht["platform_twitter_image"] == null ? "" : (string)ht["platform_twitter_image"]; model.platform_twitter_key = ht["platform_twitter_key"] == null ? "" : (string)ht["platform_twitter_key"]; model.platform_twitter_secret = ht["platform_twitter_secret"] == null ? "" : (string)ht["platform_twitter_secret"]; model.platform_taobao_sessionkey = ht["platform_taobao_sessionkey"] == null ? "" : (string)ht["platform_taobao_sessionkey"]; model.platform_taobao_shopnick = ht["platform_taobao_shopnick"] == null ? "" : (string)ht["platform_taobao_shopnick"]; model.platform_weixin_number = ht["platform_weixin_number"] == null ? "" : (string)ht["platform_weixin_number"]; model.platform_weixin_id = ht["platform_weixin_id"] == null ? "" : (string)ht["platform_weixin_id"]; model.platform_weixin_image = ht["platform_weixin_image"] == null ? "" : (string)ht["platform_weixin_image"]; model.platform_weixin_image_qrcode = ht["platform_weixin_image_qrcode"] == null ? "" : (string)ht["platform_weixin_image_qrcode"]; model.platform_weixin_secret = ht["platform_weixin_secret"] == null ? "" : (string)ht["platform_weixin_secret"]; model.platform_weixin_custemtoken = ht["platform_weixin_custemtoken"] == null ? "" : (string)ht["platform_weixin_custemtoken"]; model.platform_weixin_subscribe_automsg = ht["platform_weixin_subscribe_automsg"] == null ? "" : (string)ht["platform_weixin_subscribe_automsg"]; model.TakeMoneyLimit = ht["TakeMoneyLimit"] == null ? "100" : (string)ht["TakeMoneyLimit"]; model.WithdrawalFeeRate = ht["WithdrawalFeeRate"] == null ? "0" : (string)ht["WithdrawalFeeRate"]; model.AdminLanguages = ht["AdminLanguages"] == null ? "" : (string)ht["AdminLanguages"]; model.OrderReceivedDays = ht["OrderReceivedDays"] == null ? "0" : (string)ht["OrderReceivedDays"]; model.OrderCompleteDays = ht["OrderCompleteDays"] == null ? "0" : (string)ht["OrderCompleteDays"]; model.APIPassWord = ht["APIPassWord"] == null ? "" : (string)ht["APIPassWord"]; model.LebiAPI = ht["LebiAPI"] == null ? "" : (string)ht["LebiAPI"]; model.HTTPServer = ht["HTTPServer"] == null ? "http" : (string)ht["HTTPServer"]; model.TaxRate = ht["TaxRate"] == null ? "0" : (string)ht["TaxRate"]; //开关 model.IsAnonymousUser = ht["IsAnonymousUser"] == null ? "0" : (string)ht["IsAnonymousUser"]; model.TopAreaid = ht["TopAreaid"] == null ? "0" : (string)ht["TopAreaid"]; model.IsOpenPaidOrderConfirm = ht["IsOpenPaidOrderConfirm"] == null ? "0" : (string)ht["IsOpenPaidOrderConfirm"]; model.TopAreaid = model.TopAreaid == "" ? "0" : model.TopAreaid; model.IsNullStockDown = ht["IsNullStockDown"] == null ? "0" : (string)ht["IsNullStockDown"]; model.IsNullStockSale = ht["IsNullStockSale"] == null ? "0" : (string)ht["IsNullStockSale"]; model.IsPointToMoney = ht["IsPointToMoney"] == null ? "0" : (string)ht["IsPointToMoney"]; model.PluginUsed = ht["PluginUsed"] == null ? "" : (string)ht["PluginUsed"]; model.IsClosetuihuo = ht["IsClosetuihuo"] == null ? "0" : (string)ht["IsClosetuihuo"]; model.IsSupplierCash = ht["IsSupplierCash"] == null ? "0" : (string)ht["IsSupplierCash"]; model.IsOpenUserEnd = ht["IsOpenUserEnd"] == null ? "0" : (string)ht["IsOpenUserEnd"]; model.UserRegCheckedType = ht["UserRegCheckedType"] == null ? "" : (string)ht["UserRegCheckedType"]; model.DefaultUserEndDays = ht["DefaultUserEndDays"] == null ? "0" : (string)ht["DefaultUserEndDays"]; model.IsMutiCurrencyShow = ht["IsMutiCurrencyShow"] == null ? "0" : (string)ht["IsMutiCurrencyShow"]; model.ProductStockFreezeTime = ht["ProductStockFreezeTime"] == null ? "orderconfirm" : (string)ht["ProductStockFreezeTime"]; model.IsAllowOutSideAjax = ht["IsAllowOutSideAjax"] == null ? "0" : (string)ht["IsAllowOutSideAjax"]; model.SafeIPs = ht["SafeIPs"] == null ? "" : (string)ht["SafeIPs"]; model.ProductLimitType = ht["ProductLimitType"] == null ? "0" : (string)ht["ProductLimitType"]; //代理 model.Angent_Commission = ht["Angent_Commission"] == null ? "" : (string)ht["Angent_Commission"]; model.Angent_Commission_require = ht["Angent_Commission_require"] == null ? "" : (string)ht["Angent_Commission_require"]; model.Angent1_Commission = ht["Angent1_Commission"] == null ? "" : (string)ht["Angent1_Commission"]; model.Angent2_Commission = ht["Angent2_Commission"] == null ? "" : (string)ht["Angent2_Commission"]; model.IsUsedAgent = ht["IsUsedAgent"] == null ? "0" : (string)ht["IsUsedAgent"]; model.IsUsedAgent_Area = ht["IsUsedAgent_Area"] == null ? "0" : (string)ht["IsUsedAgent_Area"]; model.IsUsedAgent_Product = ht["IsUsedAgent_Product"] == null ? "0" : (string)ht["IsUsedAgent_Product"]; model.CommissionMoneyDays = ht["CommissionMoneyDays"] == null ? "0" : (string)ht["CommissionMoneyDays"]; model.AgentEndDays = ht["AgentEndDays"] == null ? "0" : (string)ht["AgentEndDays"]; //手机短信 model.SMSTPL_newuser = ht["SMSTPL_newuser"] == null ? "" : (string)ht["SMSTPL_newuser"]; model.SMSTPL_ordersubmit = ht["SMSTPL_ordersubmit"] == null ? "" : (string)ht["SMSTPL_ordersubmit"]; model.SMSTPL_ordershipping = ht["SMSTPL_ordershipping"] == null ? "" : (string)ht["SMSTPL_ordershipping"]; model.SMSTPL_balance = ht["SMSTPL_balance"] == null ? "" : (string)ht["SMSTPL_balance"]; model.SMSTPL_getpwd = ht["SMSTPL_getpwd"] == null ? "" : (string)ht["SMSTPL_getpwd"]; model.SMSTPL_getnewpwd = ht["SMSTPL_getnewpwd"] == null ? "" : (string)ht["SMSTPL_getnewpwd"]; model.SMSTPL_comment = ht["SMSTPL_comment"] == null ? "" : (string)ht["SMSTPL_comment"]; model.SMSTPL_ask = ht["SMSTPL_ask"] == null ? "" : (string)ht["SMSTPL_ask"]; model.SMSTPL_message = ht["SMSTPL_message"] == null ? "" : (string)ht["SMSTPL_message"]; model.SMSTPL_checkcode = ht["SMSTPL_checkcode"] == null ? "" : (string)ht["SMSTPL_checkcode"]; model.SMSTPL_Admin_newuser = ht["SMSTPL_Admin_newuser"] == null ? "" : (string)ht["SMSTPL_Admin_newuser"]; model.SMSTPL_Admin_ordersubmit = ht[""] == null ? "" : (string)ht["SMSTPL_Admin_ordersubmit"]; model.SMSTPL_Admin_orderrecive = ht["SMSTPL_Admin_orderrecive"] == null ? "" : (string)ht["SMSTPL_Admin_orderrecive"]; model.SMSTPL_Admin_ordercomment = ht["SMSTPL_Admin_ordercomment"] == null ? "" : (string)ht["SMSTPL_Admin_ordercomment"]; model.SMSTPL_Admin_ordersubmit = ht["SMSTPL_Admin_ordersubmit"] == null ? "" : (string)ht["SMSTPL_Admin_ordersubmit"]; model.SMSTPL_Admin_inquiry = ht["SMSTPL_Admin_inquiry"] == null ? "" : (string)ht["SMSTPL_Admin_inquiry"]; model.SMSTPL_Admin_comment = ht["SMSTPL_Admin_comment"] == null ? "" : (string)ht["SMSTPL_Admin_comment"]; model.SMSTPL_Admin_ask = ht["SMSTPL_Admin_ask"] == null ? "" : (string)ht["SMSTPL_Admin_ask"]; model.SMSTPL_Admin_message = ht["SMSTPL_Admin_message"] == null ? "" : (string)ht["SMSTPL_Admin_message"]; model.SMS_user = ht["SMS_user"] == null ? "" : (string)ht["SMS_user"]; model.SMS_password = ht["SMS_password"] == null ? "" : (string)ht["SMS_password"]; model.SMS_server = ht["SMS_server"] == null ? "0" : (string)ht["SMS_server"]; model.SMS_state = ht["SMS_state"] == null ? "0" : (string)ht["SMS_state"]; model.SMS_apitype = ht["SMS_apitype"] == null ? "3" : (string)ht["SMS_apitype"]; model.SMS_sendmode = ht["SMS_sendmode"] == null ? "" : (string)ht["SMS_sendmode"]; model.SMS_reciveno = ht["SMS_reciveno"] == null ? "" : (string)ht["SMS_reciveno"]; model.SMS_serverport = ht["SMS_serverport"] == null ? "0" : (string)ht["SMS_serverport"]; model.SMS_maxlen = ht["SMS_maxlen"] == null ? "" : (string)ht["SMS_maxlen"]; model.SMS_lastmsg = ht["SMS_lastmsg"] == null ? "" : (string)ht["SMS_lastmsg"]; model.SMS_httpapi = ht["SMS_httpapi"] == null ? "" : (string)ht["SMS_httpapi"]; model.IsMobilePhoneMutiReg = ht["IsMobilePhoneMutiReg"] == null ? "0" : (string)ht["IsMobilePhoneMutiReg"]; //退税 model.Refund_StepR = ht["Refund_StepR"] == null ? "" : (string)ht["Refund_StepR"]; model.Refund_MinMoney = ht["Refund_MinMoney"] == null ? "0" : (string)ht["Refund_MinMoney"]; model.Refund_VAT = ht["Refund_VAT"] == null ? "0" : (string)ht["Refund_VAT"]; //新事件 model.NewEvent_Order_IsVerified = ht["NewEvent_Order_IsVerified"] == null ? "" : (string)ht["NewEvent_Order_IsVerified"]; model.NewEvent_Order_IsPaid = ht["NewEvent_Order_IsPaid"] == null ? "" : (string)ht["NewEvent_Order_IsPaid"]; model.NewEvent_Order_IsShipped = ht["NewEvent_Order_IsShipped"] == null ? "" : (string)ht["NewEvent_Order_IsShipped"]; //验证码 model.Verifycode_UserRegister = ht["Verifycode_UserRegister"] == null ? "0" : (string)ht["Verifycode_UserRegister"]; model.Verifycode_UserLogin = ht["Verifycode_UserLogin"] == null ? "0" : (string)ht["Verifycode_UserLogin"]; model.Verifycode_ForgetPassword = ht["Verifycode_ForgetPassword"] == null ? "0" : (string)ht["Verifycode_ForgetPassword"]; model.Verifycode_SupplierRegister = ht["Verifycode_SupplierRegister"] == null ? "0" : (string)ht["Verifycode_SupplierRegister"]; model.Verifycode_SupplierLogin = ht["Verifycode_SupplierLogin"] == null ? "0" : (string)ht["Verifycode_SupplierLogin"]; model.Verifycode_AdminLogin = ht["Verifycode_AdminLogin"] == null ? "0" : (string)ht["Verifycode_AdminLogin"]; return(model); }
/// <summary> /// 订单提交 /// </summary> /// <param name="user"></param> /// <param name="order"></param> public static void SendSMS_ordersubmit(Lebi_User user, Lebi_Order order) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsUserSms = 0; int IsUserSms2 = 0; int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_ordersubmit")) { IsUserSms = 1; } if (conf.SMS_sendmode.Contains("SMSTPL_Admin_ordersubmit")) { IsAdminSms = 1; } if (conf.SMS_sendmode.Contains("SMSTPL_orderpickup")) { IsUserSms2 = 1; } if (order.Supplier_id > 0) { if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_ordersubmit")) { IsSupplierSms = 1; } } if (IsUserSms == 0 && IsUserSms2 == 0 && IsAdminSms == 0 && IsSupplierSms == 0) { return; } if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string list = ""; List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", ""); foreach (Lebi_Order_Product pro in pros) { list += "" + Language.Tag("商品编号", user.Language) + ":" + pro.Product_Number + ";" + Language.Tag("商品", user.Language) + ":" + Language.Content(pro.Product_Name, user.Language) + ";" + Language.Tag("数量", user.Language) + ":" + pro.Count + ";"; } if (IsUserSms == 1) { string content = Language.Content(conf.SMSTPL_ordersubmit, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$OrderNO}", order.Code); content = content.Replace("{$Money}", Language.FormatMoney(order.Money_Order, order.Currency_Code)); content = content.Replace("{$Order}", list); Send(order.T_MobilePhone, content); } if (IsAdminSms == 1 || IsSupplierSms == 1) { string Admin_content = Language.Content(conf.SMSTPL_Admin_ordersubmit, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); Admin_content = Admin_content.Replace("{$OrderNO}", order.Code); Admin_content = Admin_content.Replace("{$Money}", Language.FormatMoney(order.Money_Order, order.Currency_Code)); Admin_content = Admin_content.Replace("{$Order}", list); string transport = "order.Transport_Name"; if (order.PickUp_Name != "") { transport += "|" + order.PickUp_Name + "|" + order.PickUp_Date.ToString("yyyy-MM-dd"); } Admin_content = Admin_content.Replace("{$Transport}", transport); 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); } } if (IsUserSms2 == 1) { string content = Language.Content(conf.SMSTPL_orderpickup, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$OrderNO}", order.Code); content = content.Replace("{$Money}", Language.FormatMoney(order.Money_Order, order.Currency_Code)); content = content.Replace("{$Order}", list); content = content.Replace("{$PickUpStation}", order.PickUp_Name); content = content.Replace("{$PickUpTime}", order.PickUp_Date.ToString("yyyy-MM-dd")); Send(order.T_MobilePhone, content); } }