Пример #1
0
        public void LoadPage()
        {
            if (!AjaxLoadCheck())
            {
                return;
            }
            string msg = "";

            HttpFileCollection files = HttpContext.Current.Request.Files;
            BaseConfig         conf  = ShopCache.GetBaseConfig();
            B_WaterConfig      bc    = new B_WaterConfig();
            WaterConfig        mx    = bc.LoadConfig();

            if (files.Count > 0)
            {
                ///'检查文件扩展名字
                HttpPostedFile postedFile = files[0];
                string         name = "icon";
                string         savepath = GetPath();
                string         fileName, fileExtension;
                fileName      = System.IO.Path.GetFileName(postedFile.FileName);
                fileExtension = System.IO.Path.GetExtension(fileName);
                name          = name + fileExtension;
                string ServerPath = System.Web.HttpContext.Current.Server.MapPath("/");
                string fdir  = ServerPath + savepath + "/icon" + fileExtension;
                string fdirs = ServerPath + savepath + "/icon_small" + fileExtension;
                if (File.Exists(fdir))
                {
                    File.Delete(fdir);
                }
                if (File.Exists(fdirs))
                {
                    File.Delete(fdirs);
                }
                int status = ImageHelper.SaveImage(postedFile, savepath, name);
                if (status != 290)
                {
                    msg = Language.Tag(EX_Type.TypeName(status));
                    Response.Write("{\"msg\":\"" + msg + "\"}");
                    return;
                }

                string OldImage = savepath + name;
                //生成所有自定义规格
                ImageHelper.UPLoad(OldImage, savepath, "icon_small" + fileExtension, 100, 100, "Cut");

                //写入数据库
                Lebi_Image model = new Lebi_Image();
                model.Image     = name;
                model.Keyid     = 0;
                model.Size      = "100,100";
                model.TableName = "temp";
                B_Lebi_Image.Add(model);
                msg = "OK";
                Response.Write("{\"msg\":\"" + msg + "\",\"ImageUrl\":\"" + model.Image + "\"}");
                return;
            }
            msg = Language.Tag("没有选择任何文件", "");
            Response.Write("{\"msg\":\"" + msg + "\"}");
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("servicepanel_config", "编辑客服面板配置"))
            {
                WindowNoPower();
            }
            B_ServicePanel config = new B_ServicePanel();

            model = ShopCache.GetBaseConfig();

            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);
            //=====================================
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_product_list", "商品列表"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id);
            int          SonCount = B_Lebi_Product.Counts("Supplier_id = " + CurrentSupplier.id + " and Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "Product_id = " + pro.id;
            }
            else
            {
                sql = "Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where b.Supplier_id = " + CurrentSupplier.id + " and " + sql + " and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }

            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Пример #4
0
        public void LoadPage()
        {
            if (!AjaxLoadCheck())
            {
                return;
            }
            string             msg   = "";
            HttpFileCollection files = HttpContext.Current.Request.Files;

            if (files.Count > 0)
            {
                ///'检查文件扩展名字
                HttpPostedFile postedFile = files[0];
                //string name = DateTime.Now.ToString("yyMMddssfff") + "_w$h_";
                string savepath = GetPath(ShopCache.GetBaseConfig().UpLoadPath);
                string fileName, fileExtension;
                fileName      = System.IO.Path.GetFileName(postedFile.FileName);
                fileExtension = System.IO.Path.GetExtension(fileName);
                //name = name + fileExtension;
                int status = FileHelper.UPLoad(postedFile, savepath, fileName);
                if (status != 290)
                {
                    msg = Language.Tag(EX_Type.TypeName(status));
                    Response.Write("{\"msg\":\"" + msg + "\"}");
                    return;
                }
                else
                {
                    Response.Write("{\"msg\":\"OK\",\"url\":\"" + savepath + fileName + "\"}");
                    return;
                }
            }
            msg = Language.Tag("没有选择任何文件");
            Response.Write("{\"msg\":\"" + msg + "\"}");
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("smsconfig_edit", "手机短信设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model        = ShopCache.GetBaseConfig();
            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 = "******";
            }
        }
Пример #6
0
        /// <summary>
        /// 验证消息真实性
        /// </summary>
        /// <returns></returns>
        public bool Check()
        {
            BaseConfig bcf       = ShopCache.GetBaseConfig();
            string     signature = RequestTool.RequestString("signature");
            string     timestamp = RequestTool.RequestString("timestamp");
            string     nonce     = RequestTool.RequestString("nonce");
            string     echostr   = RequestTool.RequestString("echostr");
            string     token     = bcf.platform_weixin_custemtoken;

            string[] arr = { token, timestamp, nonce };
            Array.Sort(arr);
            string temp = arr[0] + arr[1] + arr[2];
            string sha1 = FormsAuthentication.HashPasswordForStoringInConfigFile(temp, "SHA1").ToLower();

            //SystemLog.Add(sha1 + "---------" + signature + "------------" + echostr);
            if (sha1 == signature)
            {
                if (echostr != "")
                {
                    Response.Write(echostr);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #7
0
        /// <summary>
        /// 邮件分享朋友
        /// </summary>
        public void SendFriend()
        {
            int          id           = RequestTool.RequestInt("id", 0);
            string       FromUserName = RequestTool.RequestSafeString("UserName");
            string       FromEmail    = RequestTool.RequestSafeString("Email");
            string       Content      = RequestTool.RequestSafeString("Content");
            string       ToUserName   = RequestTool.RequestSafeString("ToUserName");
            string       ToEmail      = RequestTool.RequestSafeString("ToEmail");
            Lebi_Product product      = B_Lebi_Product.GetModel(id);

            if (product == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            //发送邮件
            try
            {
                if (ShopCache.GetBaseConfig().MailSign.ToLower().Contains("sendfriend"))
                {
                    Email.SendEmail_sendfriend(FromUserName + "|" + FromEmail, ToUserName + "|" + ToEmail, Content, product, CurrentLanguage.Code);
                }
            }
            catch (Exception ex)
            {
                Response.Write("{\"msg\":\"" + ex.Message + "\"}");
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("order_edit", "编辑订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            string where = "id = " + id + "";
            if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids))
            {
                where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))";
            }
            if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids))
            {
                where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))";
            }
            model = B_Lebi_Order.GetModel(where);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            config = ShopCache.GetBaseConfig();
            pros   = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");
            comms  = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + " and User_id = " + model.User_id + " and Admin_id = 0", "id desc");
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("product_edit", "编辑商品"))
            {
                WindowNoPower();
            }
            id = RequestTool.RequestInt("id");
            string       sql      = "";
            Lebi_Product pro      = B_Lebi_Product.GetModel(id);
            int          SonCount = B_Lebi_Product.Counts("Product_id = " + pro.id + "");

            if (SonCount == 0)
            {
                sql = "a.Product_id = " + pro.id;
            }
            else
            {
                sql = "a.Product_id in (select Lebi_Product.id from Lebi_Product where Lebi_Product.Product_id = " + pro.id + ")";
            }
            //string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where Product_Number=lbsql{'" + Number + "'} and a.Count > a.Count_Shipped and b.IsInvalid = 0";
            string where = "select a.id from Lebi_Order_Product as a inner join  Lebi_Order as b on a.Order_id = b.id where " + sql + " and (a.Count - a.Count_Shipped)!=0 and b.IsInvalid = 0 and b.IsCompleted = 0 and b.Type_id_OrderType = 211";
            if (ShopCache.GetBaseConfig().ProductStockFreezeTime == "orderconfirm")
            {
                where += " and IsVerified=1";
            }
            //where += " and IsShipped=0";
            pros = B_Lebi_Order_Product.GetList("id in (" + where + ")", "");
        }
Пример #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!EX_Admin.Power("baseconfig_edit", "基本设置"))
     {
         PageReturnMsg = PageNoPowerMsg();
     }
     model = ShopCache.GetBaseConfig();
 }
Пример #11
0
        public weixin(int _DT_id, Lebi_Site CurrentSite = null)
        {
            DT_id = _DT_id;
            BaseConfig_DT dtbcf = null;

            if (DT_id > 0)
            {
                dtbcf = ShopCache.GetBaseConfig_DT(DT_id);
                if (dtbcf != null)
                {
                    appid          = dtbcf.platform_weixin_id;
                    appkey         = dtbcf.platform_weixin_secret;
                    number         = dtbcf.platform_weixin_number;
                    platform_image = dtbcf.platform_weixin_image;
                }
            }
            if (DT_id == 0 || dtbcf == null)
            {
                if (CurrentSite != null)
                {
                    if (CurrentSite.platform_weixin_id != "" && CurrentSite.platform_weixin_secret != "")
                    {
                        appid  = CurrentSite.platform_weixin_id;
                        appkey = CurrentSite.platform_weixin_secret;
                        number = CurrentSite.platform_weixin_number;
                    }
                    if (appid == "")
                    {
                        appid = ShopCache.GetBaseConfig().platform_weixin_id;
                    }
                    if (appkey == "")
                    {
                        appkey = ShopCache.GetBaseConfig().platform_weixin_secret;
                    }
                    if (number == "")
                    {
                        number = ShopCache.GetBaseConfig().platform_weixin_number;
                    }
                    platform_image = ShopCache.GetBaseConfig().platform_weixin_image;
                }
                else
                {
                    BaseConfig bcf = ShopCache.GetBaseConfig();
                    appid          = bcf.platform_weixin_id;
                    appkey         = bcf.platform_weixin_secret;
                    number         = bcf.platform_weixin_number;
                    platform_image = bcf.platform_weixin_image;
                }
            }
            Model.weixin.token t = GetToken();
            Token = t.access_token;

            Shop.Bussiness.Site site = new Shop.Bussiness.Site();
            url      = "https://api.weixin.qq.com/";
            reurnurl = ShopCache.GetBaseConfig().HTTPServer + "://" + RequestTool.GetRequestDomain() + site.WebPath + "/platform/login_weixin.aspx";
        }
Пример #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("transport_kuaidi100_edit", "快递100配置"))
            {
                WindowNoPower();
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("appconfig_edit", "APP设置"))
            {
                WindowNoPower();
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
Пример #14
0
        /// <summary>
        /// 晒单评论
        /// </summary>
        public void Comment_reply()
        {
            int          id         = RequestTool.RequestInt("id", 0);
            int          Product_id = 0;
            Lebi_Product product    = B_Lebi_Product.GetModel(id);

            if (product != null)
            {
                Product_id = product.Product_id;
            }
            Lebi_Comment pmodel = B_Lebi_Comment.GetModel(id);

            if (pmodel == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            string Content = RequestTool.RequestSafeString("comment");

            if (Content == "")
            {
                Response.Write("{\"msg\":\"" + Tag("内容不能为空") + "\"}");
                return;
            }
            Lebi_Comment model = new Lebi_Comment();

            model.TableName = "Product";
            model.Keyid     = id;
            //model.Admin_UserName = CurrentUser.NickName;
            model.Admin_id      = 0;
            model.User_id       = CurrentUser.id;
            model.User_UserName = CurrentUser.NickName;
            model.Content       = Content;
            model.Parentid      = id;
            model.Status        = 280;
            model.Time_Add      = System.DateTime.Now;
            model.Language_Code = CurrentLanguage.Code;
            model.Product_id    = Product_id;
            model.IsRead        = 0;
            model.Supplier_id   = product.Supplier_id;
            if (!Comment.CheckSafeWord(model.Content))
            {
                Response.Write("{\"msg\":\"" + Tag("内容中包含敏感词") + "\"}");
                return;
            }
            B_Lebi_Comment.Add(model);
            //发送邮件
            if (ShopCache.GetBaseConfig().AdminMailSign.ToLower().Contains("comment"))
            {
                Lebi_User user = B_Lebi_User.GetModel(CurrentUser.id);
                Email.SendEmail_comment(user, model);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Пример #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("agent_config", "代理-参数设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
Пример #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("platformconfig_edit", "第三方平台设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
Пример #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("backup_config", "数据备份配置"))
            {
                WindowNoPower();
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model    = ShopCache.GetBaseConfig();
            IsEnable = CheckServer();
        }
Пример #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("theme_sms_edit", "编辑短信模板"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            type = RequestTool.RequestString("type");
            if (type == "")
            {
                type = "user";
            }
            model = ShopCache.GetBaseConfig();
        }
Пример #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            inputname = RequestTool.RequestString("n");
            i         = RequestTool.RequestString("i");

            if (inputname == "")
            {
                inputname = "Images";
            }
            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model = ShopCache.GetBaseConfig();
        }
Пример #20
0
        public string GetList()
        {
            string str = "";

            try
            {
                string backpath = ShopCache.GetBaseConfig().DataBase_BackPath;
                string backname = ShopCache.GetBaseConfig().DataBase_BackName;


                //if (backpath.IndexOf("/") == 0)
                //{
                //    backpath = System.Web.HttpRuntime.AppDomainAppPath + "/" + backpath;
                //}
                //else
                //{
                backpath = System.Web.HttpRuntime.AppDomainAppPath + backpath;
                //}
                if (!Directory.Exists(backpath))
                {//目录不存在,创建目录
                    Directory.CreateDirectory(backpath);
                }
                DirectoryInfo mydir = new DirectoryInfo(backpath);
                FileInfo[]    files = mydir.GetFiles();
                foreach (FileInfo file in files)
                {
                    str += "<tr class=\"list\">";
                    if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                    {
                        str += "<td><label class=\"custom-control custom-checkbox\"><input type=\"checkbox\" id=\"checkbox" + file.Name + "\" name=\"files\" value=\"" + file.Name + "\" class=\"custom-control-input\" del=\"true\"><span class=\"custom-control-label\"></span></label></td>";
                    }
                    else
                    {
                        str += "<td class=\"center\"><input type=\"checkbox\" value=\"" + file.Name + "\" name=\"files\" del=\"true\" /></td>";
                    }
                    str += "<td>" + file.Name + "";
                    if (EX_Admin.Power("backup_down", "数据备份下载"))
                    {
                        str += "&nbsp;&nbsp;<a href=\"" + ShopCache.GetBaseConfig().DataBase_BackPath + "/" + file.Name + "\">" + Tag("下载") + "</a>";
                    }
                    str += "</td><td>" + Math.Round(Convert.ToDouble(file.Length) / 1024 / 1024, 2) + "</td><td>" + file.CreationTime + "</td>";
                    str += "</tr>";
                }
            }
            catch (Exception ex)
            {
            }
            return(str);
        }
Пример #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_order_print", "打印订单"))
            {
                NewPageNoPower();
            }
            int id = RequestTool.RequestInt("id", 0);

            model = B_Lebi_Order.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Order();
            }
            config = ShopCache.GetBaseConfig();
            pros   = B_Lebi_Order_Product.GetList("Supplier_id = " + CurrentSupplier.id + " and Order_id=" + model.id + "", "");
            comms  = B_Lebi_Comment.GetList("Supplier_id = " + CurrentSupplier.id + " and TableName='Order' and Keyid=" + model.id + " and User_id = " + model.User_id + " and Admin_id = 0", "id desc");
        }
Пример #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("baseconfig_edit", "基本设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model  = ShopCache.GetBaseConfig();
            stepRs = B_BaseConfig.StepR(model.Refund_StepR);
            if (stepRs == null)
            {
                stepRs = new List <BaseConfigStepR>();
            }
        }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("emailconfig_edit", "编辑邮件设置"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            B_BaseConfig bconfig = new B_BaseConfig();

            //model = bconfig.LoadConfig();
            model    = ShopCache.GetBaseConfig();
            password = model.MailPassWord;
            if (password != "")
            {
                password = "******";
            }
        }
Пример #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string apipwd = LB.Tools.RequestTool.RequestString("apipwd");

            if (apipwd != ShopCache.GetBaseConfig().APIPassWord || apipwd == "")
            {
                Response.Write("{\"msg\":\"验证失败\"}");
                return;
            }
            string     action     = LB.Tools.RequestTool.RequestString("action");
            Type       type       = this.GetType();
            MethodInfo methodInfo = type.GetMethod(action);

            if (methodInfo != null)
            {
                methodInfo.Invoke(this, null);
            }
        }
Пример #25
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (!Shop.LebiAPI.Service.Instanse.Check("plugin_agent"))
            {
                Response.Write(Tag("权限不足"));
                Response.End();
            }
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            BaseConfig bc = ShopCache.GetBaseConfig();

            LoadTheme(themecode, siteid, languagecode, pcode);
            path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Tag("推广佣金") + "</span></a>";
            decimal.TryParse(bc.Angent1_Commission, out Angent1_Commission);
            decimal.TryParse(bc.Angent2_Commission, out Angent2_Commission);
            Lebi_Agent_User agent_user = B_Lebi_Agent_User.GetModel("User_id = " + CurrentUser.id + "");

            if (agent_user != null)
            {
                if (agent_user.Angent1_Commission != -1)
                {
                    Angent1_Commission = agent_user.Angent1_Commission;
                }
                if (agent_user.Angent2_Commission != -1)
                {
                    Angent2_Commission = agent_user.Angent2_Commission;
                }
            }
            Lebi_Agent_User agent_userlevel = B_Lebi_Agent_User.GetModel("User_id = " + CurrentUser.UserLevel_id + "");

            if (agent_userlevel != null)
            {
                if (agent_userlevel.Angent1_Commission != -1)
                {
                    Angent1_Commission = agent_userlevel.Angent1_Commission;
                }
                if (agent_userlevel.Angent2_Commission != -1)
                {
                    Angent2_Commission = agent_userlevel.Angent2_Commission;
                }
            }
        }
Пример #26
0
        /// <summary>
        /// 设置授权
        /// 未登录系统时
        /// 为保证安全,此方法只能在未设置时才能使用
        /// </summary>
        public void Licence_Set()
        {
            BaseConfig bcf = ShopCache.GetBaseConfig();

            if (bcf.LicenseUserName != "" && bcf.LicensePWD != "")
            {
                Response.Write("{\"msg\":\"" + Language.Tag("请登录后操作", CurrentLanguage.Code) + "\"}");
                return;
            }
            string     LicenseUserName = RequestTool.RequestString("LicenseUserName");
            string     LicensePWD      = RequestTool.RequestString("LicensePWD");
            string     LicenseDomain   = RequestTool.RequestString("LicenseDomain").ToLower();
            BaseConfig cf = new BaseConfig();

            cf.LicensePWD      = LicensePWD;
            cf.LicenseUserName = LicenseUserName;
            cf.LicenseDomain   = LicenseDomain;
            B_BaseConfig dob = new B_BaseConfig();

            //============================================
            //获取服务端权限
            LBAPI_Licencse api;

            try
            {
                string res = Shop.LebiAPI.Service.Instanse.License_Set("SetUser", "username="******"&pwd=" + LicensePWD + "&domain=" + LicenseDomain + "&Version=" + ShopCache.GetBaseConfig().Version + "&Version_Son=" + ShopCache.GetBaseConfig().Version_Son);
                JavaScriptSerializer jss = new JavaScriptSerializer();
                api = jss.Deserialize <LBAPI_Licencse>(res);
            }
            catch (Exception)
            {
                api = new LBAPI_Licencse();
            }
            if (api.msg == "OK")
            {
                cf.LicenseMD5     = api.md5 == null ? "" : api.md5;
                cf.LicenseString  = api.data == null ? "" : api.data;
                cf.LicensePackage = api.servicepackage == null ? "" : api.servicepackage;
                dob.SaveConfig(cf);
            }
            Response.Write("{\"msg\":\"" + api.msg + "\"}");
        }
Пример #27
0
 public Facebook(int DT_id = 0)
 {
     url = "https://graph.facebook.com/";
     if (DT_id == 0)
     {
         BaseConfig bcf = ShopCache.GetBaseConfig();
         appid          = bcf.platform_facebook_id;
         appkey         = bcf.platform_facebook_secret;
         platform_image = bcf.platform_facebook_image;
     }
     else
     {
         BaseConfig_DT bcf = ShopCache.GetBaseConfig_DT(DT_id);
         appid          = bcf.platform_facebook_id;
         appkey         = bcf.platform_facebook_secret;
         platform_image = bcf.platform_facebook_image;
     }
     Shop.Bussiness.Site site = new Shop.Bussiness.Site();
     reurnurl = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/platform/login_facebook.aspx";
 }
Пример #28
0
        private void Reset_Count_Freeze()
        {
            string ProductStockFreezeTime = ShopCache.GetBaseConfig().ProductStockFreezeTime;
            List <Lebi_Product> parents   = B_Lebi_Product.GetList("Product_id = 0", "");

            foreach (Lebi_Product parent in parents)
            {
                List <Lebi_Product> pros = B_Lebi_Product.GetList("Product_id = " + parent.id + "", "");
                if (pros.Count > 0)
                {
                    foreach (Lebi_Product pro in pros)
                    {
                        EX_Product.Reset_Count_Freeze(pro);
                    }
                }
                else
                {
                    EX_Product.Reset_Count_Freeze(parent);
                }
            }
        }
Пример #29
0
 public Weibo(int _DT_id = 0)
 {
     DT_id = _DT_id;
     url   = "https://api.weibo.com/";
     if (DT_id == 0)
     {
         BaseConfig bcf = ShopCache.GetBaseConfig();
         appid          = bcf.platform_weibo_id;
         appkey         = bcf.platform_weibo_key;
         platform_image = bcf.platform_weibo_image;
     }
     else
     {
         BaseConfig_DT bcf = ShopCache.GetBaseConfig_DT(DT_id);
         appid          = bcf.platform_weibo_id;
         appkey         = bcf.platform_weibo_key;
         platform_image = bcf.platform_weibo_image;
     }
     Shop.Bussiness.Site site = new Shop.Bussiness.Site();
     reurnurl = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/platform/login_weibo.aspx";
 }
Пример #30
0
        /// <summary>
        /// 删除数据库备份
        /// </summary>
        public void BackUP_del()
        {
            if (!EX_Admin.Power("backup_del", "删除数据备份"))
            {
                AjaxNoPower();
            }
            try
            {
                string   files = RequestTool.RequestString("files");
                string[] fs    = files.Split(',');

                string backpath = ShopCache.GetBaseConfig().DataBase_BackPath;

                if (backpath.IndexOf("/") == 0)
                {
                    backpath = System.Web.HttpRuntime.AppDomainAppPath + "/" + backpath;
                }
                if (!Directory.Exists(backpath))
                {
                    Directory.CreateDirectory(backpath);
                }

                backpath = backpath + "/";
                Regex r = new Regex(@"//*/", RegexOptions.Singleline);//目的:防止类似“///”“////”“//////”的情况
                int   i = 0;
                foreach (var f in fs)
                {
                    if (!string.IsNullOrEmpty(f) && File.Exists(backpath + f))
                    {
                        File.Delete(backpath + f);
                    }
                }
                Log.Add("删除数据备份", "Backup", "", CurrentAdmin, files);
                Response.Write("{\"msg\":\"OK\"}");
            }
            catch
            {
                Response.Write("{\"msg\":\"系统错误\"}");
            }
        }