Exemplo n.º 1
0
        /// <summary>
        /// 订单发货
        /// </summary>
        /// <param name="user"></param>
        /// <param name="order"></param>
        /// <param name="torder"></param>
        public static void Push_ordershipping(Lebi_User user, Lebi_Order order, Lebi_Transport_Order torder)
        {
            BaseConfig conf = ShopCache.GetBaseConfig();

            if (conf.APPPush_sendmode.Contains("ordershipping"))
            {
                if (user.Language == "")
                {
                    user.Language = Language.Languages().FirstOrDefault().Code;
                }
                string list = "";
                List <TransportProduct> tps = new List <TransportProduct>();
                JavaScriptSerializer    jss = new JavaScriptSerializer();
                try
                {
                    tps = jss.Deserialize <List <TransportProduct> >(torder.Product);
                }
                catch (Exception)
                {
                    tps = new List <TransportProduct>();
                }
                foreach (TransportProduct pro in tps)
                {
                    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 + ";";
                }
                string content = Language.Content(conf.SMSTPL_ordershipping, user.Language);
                content = ReplaceSMSTag(content, user, conf);
                content = content.Replace("{$OrderNO}", order.Code);
                content = content.Replace("{$ExpressCompany}", torder.Transport_Name);
                content = content.Replace("{$ExpressNumber}", torder.Code);
                content = content.Replace("{$Order}", list);
                Push(user.Device_system, user.Device_id, content);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 处理文字标签
        /// </summary>
        /// <param name="str"></param>
        /// <param name="langFlag"></param>
        /// <returns></returns>
        public static string Tag(string str, string langFlag)
        {
            List <Lebi_Language_Tag> models = ShopCache.GetLanguageTag();
            Lebi_Language_Tag        tag    = (from m in models
                                               where m.tag == str
                                               select m).ToList().FirstOrDefault();

            if (tag == null)
            {
                tag = B_Lebi_Language_Tag.GetModel("tag='" + str + "'");
            }
            if (tag == null)
            {
                tag     = new Lebi_Language_Tag();
                tag.tag = str;
                tag.CN  = str;
                //tag.JP = str;
                tag.EN = str;
                B_Lebi_Language_Tag.Add(tag);
            }
            else
            {
                try
                {
                    Type         t        = tag.GetType();
                    PropertyInfo pi_count = t.GetProperty(langFlag);
                    str = pi_count.GetValue(tag, null).ToString();
                }
                catch
                {
                }
            }
            return(str);
        }
Exemplo n.º 3
0
        public bool SaveConfig(BaseConfig_DT model, int DT_id)
        {
            //return SerializationHelper.Save(model, this.xmlpath);
            Type           type = model.GetType();
            Lebi_DT_Config cf;

            foreach (System.Reflection.PropertyInfo p in type.GetProperties())
            {
                if (p.GetValue(model, null) == null)
                {
                    continue;
                }
                cf = B_Lebi_DT_Config.GetModel("DT_id = " + DT_id + " and Name='" + p.Name + "'");
                if (cf == null)
                {
                    cf       = new Lebi_DT_Config();
                    cf.Name  = p.Name;
                    cf.Value = p.GetValue(model, null).ToString();
                    cf.DT_id = DT_id;
                    B_Lebi_DT_Config.Add(cf);
                }
                else
                {
                    cf.Name  = p.Name;
                    cf.Value = p.GetValue(model, null).ToString();
                    B_Lebi_DT_Config.Update(cf);
                }
            }
            ShopCache.SetBaseConfig(DT_id);//更新缓存
            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 添加数据备份
        /// </summary>
        public static bool Add()
        {
            try
            {
                string backpath = ShopCache.GetBaseConfig().DataBase_BackPath;
                string backname = ShopCache.GetBaseConfig().DataBase_BackName;
                if (backpath.IndexOf("/") == 0)
                {
                    backpath = System.Web.HttpRuntime.AppDomainAppPath + "/" + backpath;
                }
                if (!Directory.Exists(backpath))
                {
                    Directory.CreateDirectory(backpath);
                }
                if (!backname.Contains("."))
                {
                    backname = "." + backname;
                }
                backname = System.DateTime.Now.ToString("yyyyMMddhhmmss") + backname;
                backpath = backpath + "/" + backname;
                Regex r = new Regex(@"//*/", RegexOptions.Singleline);//目的:防止类似“///”“////”“//////”的情况
                backpath = r.Replace(backpath, "/");
                string sql = "exec p_backupdb @bkfname='" + backpath + "'";
                Common.ExecuteSql(sql);
                Log.Add("备份数据库");//添加操作记录

                return(true);
            }
            catch (Exception ex)
            {
                Log.Add("备份数据库异常:", ex.Message);//添加操作记录
                return(false);
            }
        }
Exemplo n.º 5
0
        public AdminBase()
        {
            if (("," + SYS.PluginUsed + ",").Contains(",Lebi.ERP,"))
            {
                IsEditStock = false;
            }
            config               = ShopCache.GetBaseConfig();
            site                 = new Site();
            CurrentLanguage      = Language.AdminCurrentLanguage();
            CurrentAdminLanguage = Language.AdminCurrentLanguage();
            DefaultCurrency      = Language.DefaultCurrency();
            //page = RequestTool.RequestInt("page", 1);
            langs = Language.AdminLanguages();
            if (CurrentAdminGroup == null)
            {
                CurrentAdminGroup = new Lebi_Admin_Group();
            }

            if (site.SiteCount > 1)
            {
                //if (Shop.LebiAPI.Service.Instanse.Check("domain3admin"))
                //{
                domain3admin = true;
                //}
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 生成SiteMap字符串
        /// </summary>
        /// <returns></returns>
        public static string GenerateSiteMapString()
        {
            BaseConfig    bc = ShopCache.GetBaseConfig();
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?> ");
            sb.AppendLine("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"> ");
            string domain = WebConfig.Instrance.MainDomain;// bc.Domain;
            string page   = "";

            foreach (PageInfo pi in url)
            {
                page = ShopCache.GetBaseConfig().HTTPServer + "://" + domain + pi.loc;
                page = page.Replace("&", "&amp;");
                sb.AppendLine("<url>");
                sb.AppendLine(string.Format("<loc>{0}</loc>", page));
                sb.AppendLine(string.Format("<lastmod>{0}</lastmod> ", pi.lastmod.ToString("yyyy-MM-dd")));
                //sb.AppendLine(string.Format("<changefreq>{0}</changefreq> ", pi.changefreq));
                sb.AppendLine(string.Format("<priority>{0}</priority> ", pi.priority));
                sb.AppendLine("</url>");
            }

            sb.AppendLine("</urlset>");
            return(sb.ToString());
        }
Exemplo n.º 7
0
 protected ShopControl()
 {
     SYS = ShopCache.GetBaseConfig();
     //CurrentLanguage_ = B_Lebi_Language.GetList("Code='CN'", "").FirstOrDefault();
     //CurrentTheme_ = new Lebi_Theme();
     CurrentUser      = EX_User.CurrentUser();
     CurrentUserLevel = B_Lebi_UserLevel.GetModel("id=" + CurrentUser.UserLevel_id + "");
     if (CurrentUserLevel == null)
     {
         CurrentUserLevel = B_Lebi_UserLevel.GetList("", "Grade desc").FirstOrDefault();
         if (CurrentUserLevel == null)
         {
             CurrentUserLevel = new Lebi_UserLevel();
             Log.Add("会员分组有误", "User_id=" + CurrentUser.id.ToString());
         }
     }
     WebPath = RequestTool.GetConfigKey("WebPath");
     WebPath = WebPath == "/" ? "" : WebPath;
     if (WebPath != "")
     {
         int h = WebPath.Length;
         if (WebPath.LastIndexOf("/") == h - 1)
         {
             WebPath = WebPath.Remove(h - 1);
         }
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// 更新活动状态
        /// </summary>
        public void UpdateStatus()
        {
            bool flag = false;
            //取出筹备中,进行中的促销
            List <Lebi_Promotion> models = B_Lebi_Promotion.GetList("Type_id_PromotionStatus in (240,241)", "");

            foreach (Lebi_Promotion model in models)
            {
                if (model.Type_id_PromotionStatus == 240)
                {
                    if (model.Time_Start <= System.DateTime.Now && model.Time_End >= System.DateTime.Now)
                    {
                        model.Type_id_PromotionStatus = 241;
                        flag = true;
                    }
                }
                if (model.Type_id_PromotionStatus == 241)
                {
                    if (model.Time_End <= System.DateTime.Now)
                    {
                        model.Type_id_PromotionStatus = 242;//过期
                        flag = true;
                    }
                }
                B_Lebi_Promotion.Update(model);
            }
            if (flag)
            {
                ShopCache.SetCurrentPromotionType();
            }
        }
Exemplo n.º 9
0
        public void LoadTheme()
        {
            string themecode = "";
            string language  = "";
            int    siteid    = 0;
            var    nv        = CookieTool.GetCookie("ThemeStatus");

            if (!string.IsNullOrEmpty(nv.Get("language")))
            {
                language = nv.Get("language");
            }
            if (!string.IsNullOrEmpty(nv.Get("theme")))
            {
                themecode = nv.Get("theme");
            }
            if (!string.IsNullOrEmpty(nv.Get("site")))
            {
                int.TryParse(nv.Get("site"), out siteid);
            }
            if (siteid == 0)
            {
                siteid = ShopCache.GetMainSite().id;
            }
            LoadTheme(themecode, siteid, language, "", false);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 取得插件设置
        /// </summary>
        /// <returns></returns>
        public static List <PluginConfig> GetPluginConfig()
        {
            List <PluginConfig> ps = new List <PluginConfig>();

            string path = System.Web.HttpRuntime.AppDomainAppPath + "/config/";

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            DirectoryInfo mydir = new DirectoryInfo(path);

            FileInfo[] files = mydir.GetFiles();
            foreach (FileInfo f in files)
            {
                try
                {
                    string       xmlpath = path + f.Name;
                    PluginConfig model   = new PluginConfig();
                    model = (PluginConfig)SerializationHelper.Load(model.GetType(), xmlpath);
                    if (!("," + ShopCache.GetBaseConfig().PluginUsed + ",").Contains("," + model.Assembly + ","))
                    {
                        continue;
                    }
                    ps.Add(model);
                    //Response.Write(model.Assembly);
                }
                catch
                {
                    continue;
                }
            }
            return(ps);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 自定义内容
        /// </summary>
        /// <param name="user"></param>
        public static void SendSMS_custom(string SMScontent, string SMSphone)
        {
            BaseConfig conf    = ShopCache.GetBaseConfig();
            string     content = SMScontent;

            content = ReplaceSMSTag(content, null, conf);
            Send(SMSphone, content);
        }
Exemplo n.º 12
0
 public TimeWork()
 {
     conf = ShopCache.GetBaseConfig();
     licensecheck_start();
     orderReceived_start();
     cardcheck_start();
     AutoAction_10_start();
 }
Exemplo n.º 13
0
        public Site()
        {
            BaseConfig bcf = ShopCache.GetBaseConfig();

            if (!Shop.LebiAPI.Service.Instanse.Check("managelicenese"))
            {
                _SiteName = "LebiShop多语言网店系统";
                _title    = "LebiShop多语言网店系统";
            }
            else
            {
                Lebi_Site s = ShopCache.GetMainSite();
                _SiteName = Language.Content(s.Name, "CN");
                _title    = Language.Content(s.Title, "CN");
            }
            _WebPath        = RequestTool.GetConfigKey("WebPath");
            _SupplierPath   = RequestTool.GetConfigKey("SupplierPath");
            _WebPath        = _WebPath.TrimEnd('/');
            _adminpath      = _WebPath + RequestTool.GetConfigKey("AdminPath");
            _adminjspath    = _WebPath + "/theme/system/systempage/admin/js";
            _admincsspath   = _WebPath + "/theme/system/systempage/admin/css";
            _adminimagepath = _WebPath + "/theme/system/systempage/admin/images";

            if (!Shop.LebiAPI.Service.Instanse.Check("lebilicense"))
            {
                _SiteName = "LebiShop多语言网店系统"; //Language.Content(bcf.Name, Language.CurrentLanguage().Code);
                _title    = _SiteName;
            }
            if (Shop.LebiAPI.Service.Instanse.Check("domain3"))
            {
                _SiteCount = B_Lebi_Site.Counts("");
                _SiteCount = _SiteCount > 30 ? 30 : 30; //_SiteCount; // _SiteCount;
            }
            else if (Shop.LebiAPI.Service.Instanse.Check("domain20"))
            {
                _SiteCount = B_Lebi_Site.Counts("");
                _SiteCount = _SiteCount > 20 ? 20 : 20; //_SiteCount; // _SiteCount;
            }
            else if (Shop.LebiAPI.Service.Instanse.Check("domain10"))
            {
                _SiteCount = B_Lebi_Site.Counts("");
                _SiteCount = _SiteCount > 10 ? 10 : 10; //_SiteCount; // _SiteCount;
            }
            //else if (Shop.LebiAPI.Service.Instanse.Check("domain2"))
            //{
            //    _SiteCount = B_Lebi_Site.Counts("");
            //    _SiteCount = _SiteCount > 2 ? 2 : _SiteCount; // _SiteCount;
            //}
            else
            {
                _SiteCount = 2;
            }
            if (_SiteCount == 0)
            {
                _SiteCount = 2;
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 站点名称
        /// </summary>
        /// <param name="siteid"></param>
        /// <returns></returns>
        public string SiteName(int siteid)
        {
            Lebi_Site model = B_Lebi_Site.GetModel(siteid);

            if (model == null)
            {
                model = ShopCache.GetMainSite();
            }
            return(model.SubName);
        }
Exemplo n.º 15
0
 public static string GetUrlToken(string url)
 {
     try
     {
         return(Shop.Bussiness.EX_User.MD5(ShopCache.GetBaseConfig().InstallCode + url));
     }
     catch
     {
         return("");
     }
 }
Exemplo n.º 16
0
        /// <summary>
        /// 后台使用的语言
        /// </summary>
        /// <returns></returns>
        public static List <Lebi_Language_Code> AdminLanguages()
        {
            string langs = ShopCache.GetBaseConfig().AdminLanguages;

            langs = langs == "" ? "CN" : langs;
            langs = langs.Replace(",", "','");
            langs = "'" + langs + "'";
            List <Lebi_Language_Code> tmodels = B_Lebi_Language_Code.GetList("Code in (" + langs + ")", "Code asc");

            return(tmodels);
        }
Exemplo n.º 17
0
 public PageBase()
 {
     SYS           = ShopCache.GetBaseConfig();
     refPage       = RequestTool.GetUrlReferrer();
     reqPage       = RequestTool.GetRequestUrl();
     WebPath       = RequestTool.GetConfigKey("WebPath").Trim().TrimEnd('/');
     WebPath       = WebPath == "/" ? "" : WebPath;
     ImageServer   = RequestTool.GetConfigKey("ImageServer").Trim();
     CurrentDomain = RequestTool.GetRequestDomain();
     webconfig     = Shop.Bussiness.WebConfig.Instrance;
 }
Exemplo n.º 18
0
 public static string GetRequestUrlNonDomainToken()
 {
     try
     {
         return(EX_User.MD5(ShopCache.GetBaseConfig().InstallCode + System.Web.HttpContext.Current.Request.Url.PathAndQuery));
     }
     catch
     {
         return("");
     }
 }
Exemplo n.º 19
0
        /// <summary>
        /// 发送手机验证码
        /// </summary>
        /// <param name="user"></param>
        public static void SendSMS_checkcode(Lebi_User user)
        {
            BaseConfig conf    = ShopCache.GetBaseConfig();
            string     content = Language.Content(conf.SMSTPL_checkcode, user.Language);
            string     code    = Common.GetRnd(6, true, false, false, false, "");

            HttpContext.Current.Session["phonecheckcode"] = user.MobilePhone + code;
            content = ReplaceSMSTag(content, user, conf);
            content = content.Replace("{$CheckCode}", code);
            Send(user.MobilePhone, content);
        }
Exemplo n.º 20
0
        /// <summary>
        /// 生成域名绑定规则
        /// </summary>
        public static void CreateURLRewrite_shop()
        {
            HtmlEngine    save = new HtmlEngine();
            StringBuilder sb   = new StringBuilder();
            StringBuilder sb1  = new StringBuilder();
            string        str  = HtmlEngine.ReadTxt("httpd.ini");
            string        str1 = HtmlEngine.ReadTxt(".htaccess");

            if (str == "")
            {
                sb.AppendLine("[ISAPI_Rewrite]");
            }
            else
            {
                sb.AppendLine(HtmlEngine.ReadTxt("httpd.ini"));
            }
            if (str1 == "")
            {
                sb1.AppendLine("RewriteEngine On");
                sb1.AppendLine("RewriteCompatibility2 On");
                sb1.AppendLine("RepeatLimit 200");
                sb1.AppendLine("RewriteBase");
            }
            else
            {
                sb1.AppendLine(HtmlEngine.ReadTxt(".htaccess"));
            }
            List <Lebi_Supplier> models = B_Lebi_Supplier.GetList("Domain!=''", "");

            if (models.Count == 0)
            {
                return;
            }
            //RewriteCond %{HTTP_HOST} ^www.shop0769.top$
            //RewriteRule ^(.*)$ http://www.shop0769.com/shop/?id=11
            Lebi_Site site = B_Lebi_Site.GetModel("1=1 order by Sort desc");

            if (site != null)
            {
                foreach (Lebi_Supplier model in models)
                {
                    //sb1.AppendLine(@"RewriteRule //" + model.Domain + "(.*)$ /shop/?id=" + model.id + " [NC,N]");
                    //sb.AppendLine(@"RewriteRule //" + model.Domain + "/(.*) /$1/shop/?id=" + model.id + " [N,I]");

                    sb.AppendLine(@"RewriteCond Host ^" + model.Domain + "$");
                    sb.AppendLine(@"RewriteRule (.*) " + ShopCache.GetBaseConfig().HTTPServer + "://" + site.Domain + "/shop/?id=" + model.id + "$ [N,I]");

                    sb1.AppendLine(@"RewriteCond  %{HTTP_HOST} ^" + model.Domain + "$");
                    sb1.AppendLine(@"RewriteRule ^(.*)$ " + ShopCache.GetBaseConfig().HTTPServer + "://" + site.Domain + "/shop/?id=" + model.id + " [NC,N]");
                }
            }
            save.CreateFile("httpd.ini", sb.ToString(), "ascii");
            save.CreateFile(".htaccess", sb1.ToString(), "ascii");
        }
Exemplo n.º 21
0
        /// <summary>
        /// 返回默认语言
        /// </summary>
        /// <returns></returns>
        public static Lebi_Language_Code DefaultLanguage()
        {
            Lebi_Site          site = ShopCache.GetMainSite();
            Lebi_Language_Code lang = B_Lebi_Language_Code.GetList("Code in (select Code from [Lebi_Language] where Site_id=" + site.id + ")", "Code asc").FirstOrDefault();

            if (lang == null)
            {
                lang = new Lebi_Language_Code();
            }
            return(lang);
        }
Exemplo n.º 22
0
        public Site_Agent()
        {
            BaseConfig bcf = ShopCache.GetBaseConfig();

            _WebPath = RequestTool.GetConfigKey("WebPath");
            _WebPath = _WebPath.TrimEnd('/');

            _adminpath      = _WebPath + "/agent";
            _adminjspath    = _adminpath + "/js";
            _admincsspath   = _adminpath + "/css";
            _adminimagepath = _adminpath + "/images";
        }
Exemplo n.º 23
0
        /// <summary>
        /// 保存原始图片的方法
        /// 290 成功
        /// 291 文件已经存在,请重命名后上传
        /// 292 没有可上传的文件
        /// 293 格式不支持
        /// 294 修剪尺寸不能是0
        /// 295 文件不存在
        /// 296 异常
        /// 297 长度超限
        /// </summary>
        /// <param name="FileUpload"></param>
        /// <param name="path"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static int UPLoad(HttpPostedFile FileUpload, string Path, string FileName)
        {
            Path = ServerPath + Path + "/";
            if (!File.Exists(Path))   //如果路径不存在,则创建
            {
                System.IO.Directory.CreateDirectory(Path);
            }
            if (FileUpload.ContentLength > 1)   //如果是true,则表示该控件有文件要上传
            {
                string   fileContentType = FileUpload.ContentType;
                string   name            = FileUpload.FileName;            //返回文件在客户端的完全路径(包括文件名全称)
                FileInfo file            = new FileInfo(name);             //FileInfo对象表示磁盘或网络位置上的文件。提供文件的路径,就可以创建一个FileInfo对象:
                string   webFilePath     = Path + FileName;                //完整的存储路径
                if (FileUpload.ContentLength > Convert.ToDecimal(ShopCache.GetBaseConfig().UpLoadLimit) * 1024 * 1024)
                {
                    return(297);
                }
                if (File.Exists(webFilePath))
                {
                    File.Delete(webFilePath);
                }
                try
                {
                    FileUpload.SaveAs(webFilePath);
                    if (!IsAllowedExtension(webFilePath))
                    {
                        File.Delete(webFilePath);
                        return(296);
                    }
                    //bool flag = CheckPictureSafe(webFilePath);
                    //if (flag)
                    return(290);
                    //else
                    //    return 296;
                }
                catch (Exception ex)
                {
                    return(296);
                    //Msg = ex.Message;
                }

                //else
                //{
                //    return 291;
                //    //Msg = "文件已经存在,请重命名后上传!";
                //}
            }
            else
            {
                return(292);
                //Msg = "没有可上传的文件";
            }
        }
Exemplo n.º 24
0
        /// <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);
            }
        }
Exemplo n.º 25
0
 /// <summary>
 /// 页面载入检查
 /// </summary>
 public void PageLoadCheck()
 {
     if (ShopCache.GetDomainStatus() == "0")
     {
         if (!Shop.LebiAPI.Service.Instanse.Check("lebilicense"))
         {
             StringBuilder sb = new StringBuilder();
             sb.Append("Powered by <a style=\"font-size:12px;color:#00497f\" href=\"http://www.lebi.cn\" target=\"_blank\" title=\"LebiShop多语言网店系统\">LebiShop</a> ");
             sb.Append("V" + SYS.Version + "." + SYS.Version_Son);
             Response.Write("<div style=\"height:100px;padding-top:10px;text-align:left;font-size:12;\">LebiShop发现异常,您可以访问<a style=\"font-size:12px;color:#00497f\" href=\"http://www.lebi.cn\" target=\"_blank\" title=\"LebiShop多语言网店系统\">www.lebi.cn</a>寻求帮助<br>");
             Response.Write(sb.ToString() + "</div>");
         }
         else
         {
             Response.Write(SYS.Wornings);
         }
         Response.End();
         return;
     }
     if (SYS.VisitTimeFlag == "1")
     {
         //开启了禁止访问
         Response.Write(SYS.Wornings);
         Response.End();
         return;
     }
     if (SYS.IPLock != "")
     {
         string   ip    = RequestTool.GetClientIP();
         string[] locks = SYS.IPLock.Split(',');
         string   reg;
         foreach (string iplock in locks)
         {
             if (iplock == ip)
             {
                 Response.Write(SYS.Wornings);
                 Response.End();
                 return;
             }
             reg = iplock.Replace(".", @"\.");
             reg = iplock.Replace("*", @"\d+");
             if (RegexTool.Check(ip, reg))
             {
                 Response.Write(SYS.Wornings);
                 Response.End();
                 return;
             }
         }
     }
 }
Exemplo n.º 26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="user"></param>
        /// <param name="money"></param>
        /// <param name="type"></param>
        /// <param name="admin"></param>
        /// <param name="description"></param>
        /// <param name="remark"></param>
        /// <param name="fanxian">是否包含返现款消费</param>
        public static void AddMoney(Lebi_User user, decimal money, int type, Lebi_Administrator admin, string description, string remark, bool fanxian = true)
        {
            if (money == 0)
            {
                return;
            }
            Lebi_User_Money mo = new Lebi_User_Money();

            if (admin != null)
            {
                mo.Admin_id       = admin.id;
                mo.Admin_UserName = admin.UserName;
            }
            mo.Money = money;
            mo.Type_id_MoneyStatus = 181;
            mo.Type_id_MoneyType   = type;
            mo.User_id             = user.id;
            mo.User_UserName       = user.UserName;
            mo.User_RealName       = user.RealName;
            mo.Description         = description;
            mo.Remark = remark;



            //string money_ = B_Lebi_User_Money.GetValue("sum(Money)", "User_id=" + user.id + " and Type_id_MoneyStatus=181");
            //decimal Money = 0;
            //Decimal.TryParse(money_, out Money);
            if (type == 195)//返现
            {
                user.Money_fanxian = user.Money_fanxian + money;
            }
            if (type == 192 && fanxian == true)//消费
            {
                user.Money_fanxian = user.Money_fanxian + money;
                if (user.Money_fanxian < 0)
                {
                    user.Money_fanxian = 0;
                }
            }
            user.Money = user.Money + money;
            B_Lebi_User.Update(user);
            mo.Money_after         = user.Money;
            mo.Money_fanxian_after = user.Money_fanxian;
            B_Lebi_User_Money.Add(mo);
            //发送短信
            if (ShopCache.GetBaseConfig().SMS_sendmode.Contains("SMSTPL_balance"))
            {
                SMS.SendSMS_balance(user);
            }
        }
Exemplo n.º 27
0
        /// <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);
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// 处理区域代理过期
        /// </summary>
        public static void AgentAreaEnd()
        {
            int d = 0;

            int.TryParse(ShopCache.GetBaseConfig().AgentEndDays, out d);
            d = 0 - d;
            List <Lebi_Agent_Area> areas = B_Lebi_Agent_Area.GetList("User_id>0 and Time_end<'" + System.DateTime.Now.Date.AddDays(d) + "')", "");

            foreach (Lebi_Agent_Area area in areas)
            {
                area.User_id       = 0;
                area.User_UserName = "";
                B_Lebi_Agent_Area.Update(area);
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// 找回密码
        /// </summary>
        /// <param name="user"></param>
        public static void SendSMS_forgetpwd(Lebi_User user)
        {
            BaseConfig conf = ShopCache.GetBaseConfig();

            if (conf.SMS_sendmode.Contains("SMSTPL_getpwd"))
            {
                if (user.Language == "")
                {
                    user.Language = Language.Languages().FirstOrDefault().Code;
                }
                string content = Language.Content(conf.SMSTPL_getpwd, user.Language);
                content = ReplaceSMSTag(content, user, conf);
                Send(user.MobilePhone, content);
            }
        }
Exemplo n.º 30
0
        public static void ThreadPush(string system, string token, string msg)
        {
            BaseConfig model = ShopCache.GetBaseConfig();

            if (model.APPPush_state == "1")
            {
                if (system == "ios")
                {
                    ApplePush(token, msg);
                }
                else
                {
                    AndroidPush(token, msg);
                }
            }
        }