Exemplo n.º 1
0
        /// <summary>
        /// 更新type表
        ///
        /// </summary>
        public void UpdateType()
        {
            //============================================
            //获取服务端数据
            List <Lebi_Type> apis;

            try
            {
                string res = Shop.LebiAPI.Service.Instanse.API("CheckType", "");
                JavaScriptSerializer jss = new JavaScriptSerializer();
                apis = jss.Deserialize <List <Lebi_Type> >(res);
            }
            catch (Exception)
            {
                apis = new List <Lebi_Type>();
            }
            Lebi_Type model;

            foreach (Lebi_Type api in apis)
            {
                model = B_Lebi_Type.GetModel(api.id);
                if (model == null)
                {
                    B_Lebi_Type.Add(api);
                    continue;
                }
                if (model.Name == api.Name && model.Sort == api.Sort && model.Class == api.Class)
                {
                    continue;
                }
                B_Lebi_Type.Update(api);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 返回一组类型并排除授权之外的类型
        /// </summary>
        /// <param name="class_"></param>
        /// <returns></returns>
        public static List <Lebi_Type> GetTypes(string class_, string wheresql = "")
        {
            string where = "Class='" + class_ + "' " + wheresql;
            if (!Shop.LebiAPI.Service.Instanse.Check("plugin_gongyingshang"))
            {
                where += " and id !=102 and id !=103";
            }
            List <Lebi_Type> models = B_Lebi_Type.GetList(where, "Sort desc");

            return(models);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public static string TypeName(int id, string lang)
        {
            Lebi_Type model = B_Lebi_Type.GetModel(id);

            if (model != null)
            {
                if (model.Color != "")
                {
                    return("<font style=\"color:" + model.Color + "\">" + Language.Tag(model.Name, lang) + "</font>");
                }
                else
                {
                    return(Language.Tag(model.Name, lang));
                }
            }
            return("");
        }
Exemplo n.º 5
0
        /// <summary>
        /// 返回类型名称
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static string TypeName(int id)
        {
            Lebi_Type model = B_Lebi_Type.GetModel(id);

            if (model != null)
            {
                if (model.Color != "")
                {
                    return("<font style=\"color:" + model.Color + "\">" + model.Name + "</font>");
                }
                else
                {
                    return(model.Name);
                }
            }
            return("");
        }
Exemplo n.º 6
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 (datediff(d,Time_Add,'" + lbsql_dateFrom + "')<=0 and datediff(d,Time_Add,'" + 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);

            PageString = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&key=" + key + "&status=" + status + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
        }