Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("property_list", "属性规格列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            tid          = RequestTool.RequestInt("tid", 133);
            key          = RequestTool.RequestSafeString("key");
            tag          = RequestTool.RequestSafeString("tag");
            PageSize     = RequestTool.getpageSize(25);
            string where = "parentid = 0 and Type_id_ProPertyType = " + tid + "";
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'})";
            }
            if (tag != "")
            {
                if (tag == "none")
                {
                    where += " and (Tag = '' or Tag is null)";
                }
                else
                {
                    where += " and Tag = lbsql{'" + tag + "'}";
                }
            }
            models = B_Lebi_ProPerty.GetList(where, "Sort desc", PageSize, page);
            types  = B_Lebi_Type.GetList("Class='ProPertyType'", "Sort desc");
            int recordCount = B_Lebi_ProPerty.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&tid=" + tid + "&tag=" + tag + "&key=" + key + "", page, PageSize, recordCount);
            tmodel     = B_Lebi_Type.GetModel(tid);
            tags       = B_Lebi_ProPerty_Tag.GetList("Type_id_ProPertyType = " + tid + " and Supplier_id = 0", "Sort desc");
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_property", "属性规格"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }
            Lebi_ProPerty check = B_Lebi_ProPerty.GetModel(pid);

            if (check == null)
            {
                pid = B_Lebi_ProPerty.GetList("Supplier_id = " + CurrentSupplier.id + " and parentid = 0", "").FirstOrDefault().id;
            }
            PageSize     = RequestTool.getpageSize(25);
            pid          = RequestTool.RequestInt("pid", 0);
            key          = RequestTool.RequestString("key");
            pmodel       = B_Lebi_ProPerty.GetModel(pid);
            string where = "parentid=" + pid;
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'})";
            }
            models = B_Lebi_ProPerty.GetList(where, "Sort desc", PageSize, page);
            int recordCount = B_Lebi_ProPerty.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}&pid=" + pid + "&key=" + key + "", page, PageSize, recordCount);
            tmodel     = B_Lebi_Type.GetModel(pmodel.Type_id_ProPertyType);
        }
        public string TypeRadio(string class_, string name, int id, string ext, string lang)
        {
            string where = "Class='" + class_ + "'";
            if (model.IsAllowHtml != 1)
            {
                where += " and id!=122";
            }
            if (model.IsCustom != 1)
            {
                where += " and id!=123";
            }
            List <Lebi_Type> models = B_Lebi_Type.GetList(where, "Sort desc");
            string           str    = "";

            foreach (Lebi_Type t in models)
            {
                string sel = "";
                if (id == t.id)
                {
                    sel = "checked";
                }
                if (!string.IsNullOrEmpty(RequestTool.GetConfigKey("SystemAdmin").Trim()))
                {
                    str += "<label class=\"custom-control custom-radio m-r-20\"><input type=\"radio\" id=\"" + name + "" + t.id + "\" name=\"" + name + "\" value=\"" + t.id + "\" class=\"custom-control-input\" " + sel + " " + ext + "><span class=\"custom-control-label\">" + Language.Tag(t.Name, lang) + "</span></label>";
                }
                else
                {
                    str += "<label><input type=\"radio\" name=\"" + name + "\" value=\"" + t.id + "\" " + sel + " " + ext + "/>" + Language.Tag(t.Name, lang) + "</label>";
                }
            }
            return(str);
        }
Beispiel #4
0
        /// <summary>
        /// 返回一组类型并排除授权之外的类型
        /// </summary>
        /// <param name="class_"></param>
        /// <returns></returns>
        public static List <Lebi_Type> GetTypes(string class_)
        {
            string where = "Class='" + class_ + "' and id in(131,133)";
            List <Lebi_Type> models = B_Lebi_Type.GetList(where, "Sort desc");

            return(models);
        }
        public string TypeRadio(string class_, string name, int id, string ext, string lang)
        {
            string where = "Class='" + class_ + "'";
            if (model.IsAllowHtml != 1)
            {
                where += " and id!=122";
            }
            if (model.IsCustom != 1)
            {
                where += " and id!=123";
            }
            List <Lebi_Type> models = B_Lebi_Type.GetList(where, "Sort desc");
            string           str    = "";

            foreach (Lebi_Type t in models)
            {
                string sel = "";
                if (id == t.id)
                {
                    sel = "checked";
                }
                str += "<label><input type=\"radio\" name=\"" + name + "\" value=\"" + t.id + "\" " + sel + " " + ext + "/>" + Language.Tag(t.Name, lang) + "</label>";
            }
            return(str);
        }
Beispiel #6
0
        public string SearchTab()
        {
            string           str = "";
            List <Lebi_Type> ts  = B_Lebi_Type.GetList("Class='CardType'", "id asc");

            foreach (Lebi_Type t in ts)
            {
                string sel = "";
                if (cardtype == t.id)
                {
                    sel = "class=\"selected\"";
                }
                str += "<li " + sel + "><a href=\"?cardtype=" + t.id + "\"><span>" + Tag(t.Name) + "</span></a></li>";
            }
            return(str);
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("type_list", "类型管理"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize = RequestTool.getpageSize(50);
            key = RequestTool.RequestString("key");
            string where = "Class like '%Status%' and Class not like '%Upload%'";
            if (key != "")
                where += " and (Name like lbsql{'%" + key + "%'} or Class like lbsql{'%" + key + "%'})";
            models = B_Lebi_Type.GetList(where, "Class asc,Sort desc", PageSize, page);
            int recordCount = B_Lebi_Type.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&&key=" + key, page, PageSize, recordCount);
        }
Beispiel #8
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            LoadTheme(themecode, siteid, languagecode, pcode);
            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 href=\"" + URL("P_UserAsk", "") + "\"><span>" + Tag("商品咨询") + "</span></a>";

            key      = Rstring("key");
            dateFrom = Rstring("dateFrom");
            dateTo   = Rstring("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            status    = RequestTool.RequestInt("status", 0);
            types     = B_Lebi_Type.GetList("Class='AskStatus'", "sort desc");
            pageindex = RequestTool.RequestInt("page", 1);
            where     = "Parentid = 0 and TableName = 'Product_Ask' and User_id=" + CurrentUser.id + "";
            if (key != "")
            {
                where += " and (Content like lbsql{'%" + key + "%'})";
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_Add>='" + FormatDate(lbsql_dateFrom) + "'and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
            }
            if (status > 0)
            {
                where += " and (Status = " + status + ")";
            }
            comments = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
            foreach (Lebi_Comment c in comments)
            {
                c.IsRead = 1;
                B_Lebi_Comment.Update(c);
            }
            int recordCount = B_Lebi_Comment.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
            NextPage   = "?page=" + (pageindex + 1) + "&key=" + key + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "";
        }
Beispiel #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("property_list", "属性规格列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize     = RequestTool.getpageSize(25);
            lang         = RequestTool.RequestString("lang");
            key          = RequestTool.RequestString("key");
            string where = "1=1";
            if (key != "")
            {
                where += " and Name like lbsql{'%" + key + "%'}";
            }
            models = B_Lebi_ProPerty_Tag.GetList(where, "Sort desc", PageSize, page);
            int recordCount = B_Lebi_ProPerty_Tag.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&key=" + key, page, PageSize, recordCount);
            types      = B_Lebi_Type.GetList("Class='ProPertyType'", "Sort desc");
        }
Beispiel #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Power("supplier_property", "属性规格"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize     = RequestTool.getpageSize(25);
            lang         = RequestTool.RequestString("lang");
            key          = RequestTool.RequestString("key");
            string where = "Supplier_id = " + CurrentSupplier.id + "";
            if (key != "")
            {
                where += " and Name like lbsql{'%" + key + "%'}";
            }
            models = B_Lebi_ProPerty_Tag.GetList(where, "Sort desc", PageSize, page);
            int recordCount = B_Lebi_ProPerty_Tag.Counts(where);

            PageString = Shop.Bussiness.Pager.GetPaginationString("?page={0}&key=" + key, page, PageSize, recordCount);
            types      = B_Lebi_Type.GetList("Class='ProPertyType' and id in(131,133)", "Sort desc");
        }
Beispiel #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("property_add", "添加属性规格") || !EX_Admin.Power("property_edit", "编辑属性规格"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize     = RequestTool.getpageSize(25);
            pid          = RequestTool.RequestInt("pid", 0);
            key          = RequestTool.RequestString("key");
            pmodel       = B_Lebi_ProPerty.GetModel(pid);
            string where = "parentid=" + pid;
            if (key != "")
            {
                where += " and (Name like lbsql{'%" + key + "%'} or Code like lbsql{'%" + key + "%'})";
            }
            models = B_Lebi_ProPerty.GetList(where, "Sort desc", PageSize, page);
            int recordCount = B_Lebi_ProPerty.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&pid=" + pid + "&key=" + key + "", page, PageSize, recordCount);
            tmodel     = B_Lebi_Type.GetModel(pmodel.Type_id_ProPertyType);
        }
Beispiel #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string connectionString = ConfigurationManager.ConnectionStrings["constr"].ToString();

            conn = new SqlConnection(connectionString);
            conn.Open();
            tables_ = conn.GetSchema(SqlClientMetaDataCollectionNames.Tables, new string[] { null, null, null, "BASE TABLE" });

            DataTable cols_;
            string    col_name           = "";
            string    col_defaultval     = "";
            string    col_isnullable     = "";
            string    col_char_length    = "";
            string    col_type           = "";
            string    col_numeric_length = "";
            string    col_numeric_scale  = "";
            string    col_remark         = "";

            for (int i = 0; i < tables_.Rows.Count; i++)
            {
                string tablename = tables_.Rows[i]["TABLE_NAME"].ToString();
                cols_ = GetCols(tablename);
                Lebi_Table parentmodel = B_Lebi_Table.GetModel("name='" + tablename + "' and parentid=0");
                if (parentmodel == null)
                {
                    parentmodel        = new Lebi_Table();
                    parentmodel.name   = tablename;
                    parentmodel.remark = "";
                    B_Lebi_Table.Add(parentmodel);
                    parentmodel.id = B_Lebi_Table.GetMaxId();
                }
                for (int j = 0; j < cols_.Rows.Count; j++)
                {
                    col_name           = cols_.Rows[j]["COLUMN_NAME"].ToString();
                    col_defaultval     = cols_.Rows[j]["COLUMN_DEFAULT"].ToString();
                    col_isnullable     = cols_.Rows[j]["IS_NULLABLE"].ToString();
                    col_char_length    = cols_.Rows[j]["CHARACTER_MAXIMUM_LENGTH"].ToString();
                    col_type           = cols_.Rows[j]["DATA_TYPE"].ToString();
                    col_numeric_length = cols_.Rows[j]["NUMERIC_PRECISION"].ToString();
                    col_numeric_scale  = cols_.Rows[j]["NUMERIC_SCALE"].ToString();
                    col_remark         = "";
                    if (col_name.Contains("Type_id_"))
                    {
                        string           des = "";
                        List <Lebi_Type> ts  = B_Lebi_Type.GetList("Class='" + col_name.Replace("Type_id_", "") + "'", "");
                        foreach (Lebi_Type ty in ts)
                        {
                            if (des == "")
                            {
                                des = ty.id + ty.Name;
                            }
                            else
                            {
                                des += "," + ty.id + ty.Name;
                            }
                        }
                        col_remark = des;
                    }
                    Lebi_Table model = B_Lebi_Table.GetModel("name='" + col_name + "' and parentid=" + parentmodel.id);
                    if (model == null)
                    {
                        model = new Lebi_Table();
                    }
                    model.name       = col_name;
                    model.type       = col_type;
                    model.remark     = col_remark;
                    model.defaultval = col_defaultval;
                    model.isnullable = col_isnullable == "YES" ? 1 : 0;
                    model.isidentity = col_name == "id" ? 1 : 0;
                    model.ispk       = col_name == "id" ? 1 : 0;
                    try
                    {
                        model.char_length = Convert.ToInt32(col_char_length);
                    }
                    catch
                    {
                    }
                    try
                    {
                        model.numeric_scale = Convert.ToInt32(col_numeric_scale);
                    }
                    catch
                    {
                    }
                    try
                    {
                        model.numeric_length = Convert.ToInt32(col_numeric_length);
                    }
                    catch
                    {
                    }
                    model.parentid   = parentmodel.id;
                    model.parentname = parentmodel.name;
                    if (model.id == 0)
                    {
                        B_Lebi_Table.Add(model);
                    }
                    else
                    {
                        B_Lebi_Table.Update(model);
                    }
                }
            }
            //JavaScriptSerializer jss = new JavaScriptSerializer();
            //string json = jss.Serialize(tables);
            //Response.Write(json);
            Response.Write("OK");
        }
Beispiel #13
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (CurrentUser.id == 0)
            {
                Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + ""));
            }
            LoadTheme(themecode, siteid, languagecode, pcode);
            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 href=\"" + URL("P_UserComment", "") + "\"><span>" + Tag("商品评价") + "</span></a>";
            //key={0}&type={1}&status={2}&dateFrom={3}&dateTo={4}
            key      = Rstring("key");
            type     = Rint("type");
            status   = Rint("status");
            dateFrom = Rstring("dateFrom");
            dateTo   = Rstring("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            pageindex = RequestTool.RequestInt("page", 1);
            types     = B_Lebi_Type.GetList("Class='CommentStatus'", "sort desc");
            if (type == 0)
            {
                where = "Parentid = 0 and TableName = 'Product' and User_id=" + CurrentUser.id + "";
                if (key != "")
                {
                    where += " and (Content like lbsql{'%" + key + "%'})";
                }
                if (dateFrom != "" && dateTo != "")
                {
                    where += " and (datediff(d,Time_Add,'" + FormatDate(lbsql_dateFrom) + "')<=0 and datediff(d,Time_Add,'" + FormatDate(lbsql_dateTo) + "')>=0)";
                }
                if (status > 0)
                {
                    where += " and (Status = " + status + ")";
                }
                comments = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
                foreach (Shop.Model.Lebi_Comment c in comments)
                {
                    c.IsRead = 1;
                    B_Lebi_Comment.Update(c);
                }
                int recordCount = B_Lebi_Comment.Counts(where);
                //string url = URL("P_UserComment", key + "," + type + "," + status + "," + dateFrom + "," + dateTo + ",{0}");
                //PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb(url, page, PageSize, recordCount, CurrentLanguage);
                PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&type=" + type + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
            }
            else
            {
                //待评价商品
                where = "IsCommented = 0 and User_id=" + CurrentUser.id + " and id in(select id from [Lebi_Order_Product] where Order_id in(select id from [Lebi_Order] where User_id=" + CurrentUser.id + " and IsReceived = 1))";
                if (key != "")
                {
                    where += " and (Product_Name like lbsql{'%" + key + "%'})";
                }
                if (dateFrom != "" && dateTo != "")
                {
                    where += " and (datediff(d,Time_Add,'" + FormatDate(lbsql_dateFrom) + "')<=0 and datediff(d,Time_Add,'" + FormatDate(lbsql_dateTo) + "')>=0)";
                }
                order_products = B_Lebi_Order_Product.GetList(where, "id desc", PageSize, pageindex);
                int    recordCount = B_Lebi_Order_Product.Counts(where);
                string url         = URL("P_UserComment", key + "," + type + "," + status + "," + dateFrom + "," + dateTo + ",{0}");
                PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&type=" + type + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
            }
            NextPage = "?page=" + (pageindex + 1) + "&key=" + key + "&type=" + type + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "";
        }