Beispiel #1
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 #2
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 + "";
        }