Esempio n. 1
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            site    = new Site_Supplier();
            backurl = RequestTool.RequestString("url").Replace("<", "").Replace(">", "");
            if (backurl.ToLower().IndexOf("http") > -1 || backurl.ToLower().IndexOf("login.aspx") > -1 || backurl == "")
            {
                backurl = site.AdminPath + "/default.aspx?desk=1";
            }
            path      = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a>" + Tag("É̼Ò×¢²á") + "</a>";
            verifieds = B_Lebi_Supplier_Verified.GetList("", "Sort desc");
            logintype = RequestTool.RequestString("logintype", "");

            List <Lebi_Supplier> suppliers = B_Lebi_Supplier.GetList("User_id=" + CurrentUser.id + "", "id desc");

            if (logintype == "" && suppliers.Count > 0)
            {
                supplier = suppliers.FirstOrDefault();
                Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(supplier.Supplier_Group_id);
                logintype = group.type;
            }
            else
            {
                foreach (Lebi_Supplier sup in suppliers)
                {
                    Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(sup.Supplier_Group_id);
                    if (logintype == group.type)
                    {
                        supplier = sup;
                    }
                }
            }
            logintype = logintype == "" ? "supplier" : logintype;
            if (supplier == null)
            {
                supplier             = new Lebi_Supplier();
                supplier.Address     = CurrentUser.Address;
                supplier.Area_id     = CurrentUser.Area_id;
                supplier.Fax         = CurrentUser.Fax;
                supplier.Email       = CurrentUser.Email;
                supplier.MobilePhone = CurrentUser.MobilePhone;
                supplier.Msn         = CurrentUser.Msn;
                supplier.Phone       = CurrentUser.Phone;
                supplier.Postalcode  = CurrentUser.Postalcode;
                supplier.QQ          = CurrentUser.QQ;
                supplier.RealName    = CurrentUser.RealName;
                supplier.UserName    = CurrentUser.UserName;
                supplier.User_id     = CurrentUser.id;
                status = Tag("ÐÂ×¢²á");
            }
            else
            {
                if (supplier.Type_id_SupplierStatus == 442)
                {
                    Response.Redirect(site.AdminPath + "/login.aspx");
                }
                status = TypeName(supplier.Type_id_SupplierStatus);
            }
        }
Esempio n. 2
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");
        }
Esempio n. 3
0
        /// <summary>
        /// 商家下拉框
        /// </summary>
        /// <param name="id"></param>
        /// <param name="lang"></param>
        /// <returns></returns>
        public static string SupplierOption(int id, string lang = "CN")
        {
            StringBuilder        builderTree = new StringBuilder();
            List <Lebi_Supplier> nodes       = B_Lebi_Supplier.GetList("Supplier_Group_id in (select g.id from Lebi_Supplier_Group as g where g.type='supplier')", "");

            foreach (Lebi_Supplier node in nodes)
            {
                //builderTree.Append(string.Format("<option value=\"{0}\" {1}>{2}</option>  \r\n", node.id, node.id == id ? "selected=\"selected\"" : "", Language.Content(node.Name, lang)));
                builderTree.Append(string.Format("<option value=\"{0}\" {1}>{2}</option>  \r\n", node.id, node.id == id ? "selected=\"selected\"" : "", "[" + node.SubName + "]" + node.Company));
            }
            return(builderTree.ToString());
        }
Esempio n. 4
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_ShopSearch'");
            keyword     = Rstring_Para("0");

            sort  = Rstring_Para("1");
            where = "Supplier_Group_id in (select w.id from [Lebi_Supplier_Group] as w where w.type='supplier' or w.type='')";
            path  = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("Ê×Ò³") + "\"><span>" + Tag("Ê×Ò³") + "</span></a><em class=\"home\">&raquo;</em><a class=\"text\"><span>" + Tag("µêÆÌËÑË÷") + "</span></a><em>&raquo;</em><a class=\"text\"><span>¡°" + keyword + "¡±</span></a>";

            if (keyword != "")
            {
                string wherekeyword = "";
                if (keyword.IndexOf(" ") > -1)
                {
                    string[] keywordsArr;
                    keywordsArr = keyword.Split(new char[1] {
                        ' '
                    });
                    foreach (string keywords in keywordsArr)
                    {
                        if (keywords != "")
                        {
                            if (wherekeyword == "")
                            {
                                wherekeyword = "(Name like lbsql{'%" + keywords + "%'} or SubName like lbsql{'%" + keywords + "%'})";
                            }
                            else
                            {
                                wherekeyword += " and (Name like lbsql{'%" + keywords + "%'} or SubName like lbsql{'%" + keywords + "%'})";
                            }
                        }
                    }
                }
                else
                {
                    wherekeyword = "(Name like lbsql{'%" + keyword + "%'} or SubName like lbsql{'%" + keyword + "%'})";
                }
                where = wherekeyword;
            }


            //SQLDataAccess.SQLPara sp = new SQLDataAccess.SQLPara(where, "id desc", "*");
            shops       = B_Lebi_Supplier.GetList(where, "id desc", PageSize, pageindex);
            recordCount = B_Lebi_Supplier.Counts(where);
            string url = URL("P_ShopSearch", keyword + "," + sort + ",{0}");

            HeadPage = Shop.Bussiness.Pager.GetPaginationStringForWebSimple(url, pageindex, PageSize, recordCount, CurrentLanguage);
            FootPage = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, pageindex, PageSize, recordCount, CurrentLanguage);
        }
Esempio n. 5
0
        /// <summary>
        ///  商家选择
        /// </summary>
        /// <param name="InputName"></param>
        /// <param name="ids"></param>
        /// <param name="lang"></param>
        /// <returns></returns>
        public static string SupplierCheckbox(string InputName, string ids, string lang = "CN")
        {
            List <Lebi_Supplier> models = B_Lebi_Supplier.GetList("Type_id_SupplierStatus = 442", "");
            string str = "";

            foreach (Lebi_Supplier model in models)
            {
                string sel = "";
                if (("," + ids + ",").IndexOf("," + model.id + ",") > -1)
                {
                    sel = "checked";
                }
                str += "<input type=\"checkbox\" name=\"" + InputName + "\" id=\"" + InputName + "" + model.id + "\" shop=\"true\" value=\"" + model.id + "\" " + sel + "><label for=\"" + InputName + "" + model.id + "\">" + Shop.Bussiness.Language.Content(model.Name, lang) + "&nbsp;</label>";
            }
            return(str);
        }
Esempio n. 6
0
        /// <summary>
        ///  商家选择
        /// </summary>
        /// <param name="InputName"></param>
        /// <param name="ids"></param>
        /// <param name="lang"></param>
        /// <returns></returns>
        public static string SupplierCheckbox(string InputName, string ids, string lang = "CN")
        {
            List <Lebi_Supplier> models = B_Lebi_Supplier.GetList("Type_id_SupplierStatus = 442", "");
            string str = "";

            foreach (Lebi_Supplier model in models)
            {
                string sel = "";
                if (("," + ids + ",").IndexOf("," + model.id + ",") > -1)
                {
                    sel = "checked";
                }
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    str += "<label class=\"custom-control custom-checkbox m-r-20\"><input type=\"checkbox\" id=\"" + InputName + "" + model.id + "\" name=\"" + InputName + "\" value=\"" + model.id + "\" class=\"custom-control-input\" shop=\"true\" " + sel + "><span class=\"custom-control-label\">" + Shop.Bussiness.Language.Content(model.Name, lang) + "</span></label>";
                }
                else
                {
                    str += "<label><input type=\"checkbox\" name=\"" + InputName + "\" id=\"" + InputName + "" + model.id + "\" shop=\"true\" value=\"" + model.id + "\" " + sel + ">" + Shop.Bussiness.Language.Content(model.Name, lang) + "&nbsp;</label>";
                }
            }
            return(str);
        }
Esempio n. 7
0
        /// <summary>
        /// 返回当前账号的可管理超级用户
        /// </summary>
        /// <returns></returns>
        public List <Lebi_Supplier> GetSuppliers()
        {
            List <Lebi_Supplier> models = B_Lebi_Supplier.GetList("id in (select Supplier_id from [Lebi_Supplier_User] where User_id=" + CurrentSupplierUser.User_id + " and Type_id_SupplierUserStatus=9011) and id!=" + CurrentSupplier.id + "", "");

            return(models);
        }