コード例 #1
0
ファイル: ShopControl.cs プロジェクト: zwkjgs/LebiShop
 public int Count_NewMessage()
 {
     if (CurrentUser.id > 0)
     {
         return(B_Lebi_Message.Counts("User_id_to=" + CurrentUser.id + " and IsRead=0"));
     }
     else
     {
         return(0);
     }
 }
コード例 #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);
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserMessage'");
            type        = Rint_Para("0");
            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>";
            if (type == 0)
            {
                path += "<a href=\"" + URL("P_UserMessage", "0") + "\"><span>" + Tag("收件箱") + "</span></a>";
            }
            else
            {
                path += "<a href=\"" + URL("P_UserMessage", "1") + "\"><span>" + Tag("发件箱") + "</span></a>";
            }
            CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserMessage'");
            key         = Rstring("key");
            type_id     = Rstring("type_id");
            dateFrom    = Rstring("dateFrom");
            dateTo      = Rstring("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            pageindex = RequestTool.RequestInt("page", 1);
            if (type == 0)
            {
                where = "User_id_To=" + CurrentUser.id + "";
            }
            if (type == 1)
            {
                where = "User_id_From=" + CurrentUser.id + "";
            }
            if (key != "")
            {
                where += " and (Title like lbsql{'%" + key + "%'})";
            }
            if (type_id != "")
            {
                where += " and Message_Type_id = " + type_id;
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and (datediff(d,Time_Add,'" + lbsql_dateFrom + "')<=0 and datediff(d,Time_Add,'" + lbsql_dateTo + "')>=0)";
            }
            messages = B_Lebi_Message.GetList(where, "id desc", PageSize, pageindex);
            int recordCount = B_Lebi_Message.Counts(where);

            PageString    = Shop.Bussiness.Pager.GetPaginationStringForWeb("?page={0}&type=" + type + "&type_id=" + type_id + "&key=" + key + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "", pageindex, PageSize, recordCount, CurrentLanguage);
            message_types = B_Lebi_Message_Type.GetList("Type_id_MessageTypeClass = 350", "id desc");
        }
コード例 #3
0
ファイル: Message.cs プロジェクト: yzbjack/LebiShop
        /// <summary>
        /// 计算指定日期及状态的信息数量
        /// </summary>
        /// <param name="dateFrom"></param>
        /// <param name="dateTo"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static int GetCount_Message(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_Message.Counts(where);
            return(count);
        }
コード例 #4
0
ファイル: Message.cs プロジェクト: zwkjgs/LebiShop
        /// <summary>
        /// 计算指定日期及状态的信息数量
        /// </summary>
        /// <param name="dateFrom"></param>
        /// <param name="dateTo"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static int GetCount_Message(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_Message.Counts(where);
            return(count);
        }