예제 #1
0
 public int Count_ProductAsk(int IsRead)
 {
     if (CurrentUser.id > 0)
     {
         return(B_Lebi_Comment.Counts("Parentid = 0 and User_id=" + CurrentUser.id + " and TableName = 'Product_Ask' and IsRead=" + IsRead + ""));
     }
     else
     {
         return(0);
     }
 }
예제 #2
0
 public int Count_NewProductComment()
 {
     if (CurrentUser.id > 0)
     {
         return(B_Lebi_Comment.Counts("Parentid = 0 and User_id=" + CurrentUser.id + " and TableName = 'Product' and IsRead=0"));
     }
     else
     {
         return(0);
     }
 }
예제 #3
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            int id = Rint_Para("0");

            comment = B_Lebi_Comment.GetModel(id);
            if (comment.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            product      = GetProduct(comment.Keyid);
            string where = "Parentid =" + id;
            comments     = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Comment.Counts(where);

            PageString  = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id, pageindex, PageSize, recordCount, CurrentLanguage);
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
            pro_type = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type != null)
            {
                string[,] parr = Categorypath(pro_type.id);
                for (int i = 0; i <= parr.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                }
            }
            path += "<a href=\"" + URL("P_Product", product.id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em>";
            path += "<a><span>" + Tag("晒单") + "</span></a>";
            //path += "<a href=\"" + URL("P_Product", id) + "\"><span>" + Lang(product.Name) + "</span></a>";

            smalls = comment.ImagesSmall.Split('@');
            bigs   = comment.Images.Split('@');
            if (bigs.Count() > 1)
            {
                DefaultImage = bigs[1];
            }

            productcomments = B_Lebi_Comment.GetList("TableName='Product' and Keyid=" + comment.Keyid + " and id!=" + comment.id + "", "id desc", 5, 1);
        }
예제 #4
0
        protected int ProductStar;//整数的商品评分,最大为5
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            LoadTheme(themecode, siteid, languagecode, pcode);
            int id = Rint_Para("0");

            product = GetProduct(id);
            if (product.id == 0)
            {
                Response.Redirect(URL("P_404", ""));
                Response.End();
            }
            string where = "Parentid = 0 and TableName = 'Product' and (Keyid = " + id + "";
            if (product.Product_id != 0)
            {
                where += " or Product_id = " + product.Product_id + "";
            }
            where   += ") and (Status = 281 or User_id = " + CurrentUser.id + ")";
            comments = B_Lebi_Comment.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Comment.Counts(where);

            PageString  = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&id=" + id, pageindex, PageSize, recordCount, CurrentLanguage);
            ProductStar = Convert.ToInt32(product.Star_Comment);
            if (ProductStar > 5)
            {
                ProductStar = 5;
            }
            if (ProductStar < 0)
            {
                ProductStar = 0;
            }
            pro_type = B_Lebi_Pro_Type.GetModel(product.Pro_Type_id);
            path     = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">&raquo;</em>";
            if (pro_type != null)
            {
                string[,] parr = Categorypath(pro_type.id);
                for (int i = 0; i <= parr.GetUpperBound(0); i++)
                {
                    path += "<a href=\"" + URL("P_ProductCategory", "" + parr[i, 0] + "") + "\"><span>" + parr[i, 1] + "</span></a><em>&raquo;</em>";
                }
            }
            path += "<a href=\"" + URL("P_Product", product.id) + "\"><span>" + Lang(product.Name) + "</span></a><em>&raquo;</em>";
            path += "<a><span>" + Tag("商品评论") + "</span></a>";
        }
예제 #5
0
파일: Comment.cs 프로젝트: zwkjgs/LebiShop
        /// <summary>
        /// 计算指定日期及状态的评论数量
        /// </summary>
        /// <param name="dateFrom"></param>
        /// <param name="dateTo"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static int GetCount_Comment(string dateFrom, string dateTo, string status)
        {
            int count = 0;

            string where = "";
            if (dateFrom != "" && dateTo != "")
            {
                where = "Time_Add>='" + dateFrom + "' and Time_Add<='" + dateTo + "'";
            }
            if (status != "")
            {
                if (dateFrom != "" && dateTo != "")
                {
                    where += " and ";
                }
                where += status;
            }
            count = B_Lebi_Comment.Counts(where);
            return(count);
        }
예제 #6
0
파일: Comment.cs 프로젝트: yzbjack/LebiShop
        /// <summary>
        /// 计算指定日期及状态的评论数量
        /// </summary>
        /// <param name="dateFrom"></param>
        /// <param name="dateTo"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static int GetCount_Comment(string dateFrom, string dateTo, string status)
        {
            int count = 0;

            string where = "";
            if (dateFrom != "" && dateTo != "")
            {
                where = "datediff(d,Time_Add,'" + dateFrom + "')<=0 and datediff(d,Time_Add,'" + dateTo + "')>=0";
            }
            if (status != "")
            {
                if (dateFrom != "" && dateTo != "")
                {
                    where += " and ";
                }
                where += status;
            }
            count = B_Lebi_Comment.Counts(where);
            return(count);
        }
예제 #7
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);
        }