示例#1
0
        protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode)
        {
            if (!Shop.LebiAPI.Service.Instanse.Check("plugin_agent"))
            {
                Response.Write(Tag("权限不足"));
                Response.End();
            }
            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_UserAgent", "") + "\"><span>" + Tag("推广佣金") + "</span></a><em>&raquo;</em><a class=\"text\"><span>" + Tag("佣金查询") + "</span></a>";
            PageSize  = RequestTool.getpageSize(25);
            pageindex = RequestTool.RequestInt("page", 1);
            key       = RequestTool.RequestString("key");
            status    = RequestTool.RequestInt("status", 0);
            dateFrom  = Rstring("dateFrom");
            dateTo    = Rstring("dateTo");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            string where = "User_id=" + CurrentUser.id;
            if (key != "")
            {
                where += " and (Order_Code like lbsql{'%" + key + "%'} or Product_Number like lbsql{'%" + key + "%'})";
            }
            if (status > 0)
            {
                where += " and Type_id_AgentMoneyStatus=" + status;
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
            }
            models = B_Lebi_Agent_Money.GetList(where, "Time_add desc", PageSize, pageindex);
            int recordCount = B_Lebi_Agent_Money.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 + "";
            int d = 0;

            int.TryParse(SYS.CommissionMoneyDays, out d);
            d = 0 - d;
            string money_  = Common.GetValue("select sum(Money) from Lebi_Agent_Money where User_id=" + CurrentUser.id + " and Type_id_AgentMoneyStatus=382 and Time_add<'" + System.DateTime.Now.AddDays(d) + "')");
            string zmoney_ = Common.GetValue("select sum(Money) from Lebi_Agent_Money where User_id=" + CurrentUser.id + " and Type_id_AgentMoneyStatus=382");

            decimal.TryParse(money_, out money);
            decimal.TryParse(zmoney_, out zmoney);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("agent_money_list", "佣金查询"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            PageSize = RequestTool.getpageSize(25);
            dateFrom = RequestTool.RequestString("dateFrom");
            dateTo   = RequestTool.RequestString("dateTo");
            key      = RequestTool.RequestString("key");
            DateTime lbsql_dateFrom = RequestTool.RequestDate("dateFrom");
            DateTime lbsql_dateTo   = RequestTool.RequestDate("dateTo");

            status       = RequestTool.RequestInt("status", 0);
            type         = RequestTool.RequestInt("type", 0);
            supplier_id  = RequestTool.RequestInt("supplier_id", 0);
            user_id      = RequestTool.RequestInt("user_id", 0);
            string where = "1=1";
            if (key != "")
            {
                where += " and (User_UserName like lbsql{'%" + key + "%'} or Order_Code like lbsql{'%" + key + "%'})";
            }
            if (status > 0)
            {
                where += " and Type_id_AgentMoneyStatus=" + status;
            }
            if (type > 0)
            {
                where += " and Type_id_AgentMoneyType=" + type;
            }
            if (supplier_id > 0)
            {
                where += " and Supplier_id=" + supplier_id;
            }
            if (user_id > 0)
            {
                where += " and User_id=" + user_id;
            }
            if (dateFrom != "" && dateTo != "")
            {
                where += " and Time_add>='" + FormatDate(lbsql_dateFrom) + "' and Time_Add<='" + FormatDate(lbsql_dateTo) + " 23:59:59'";
            }
            models = B_Lebi_Agent_Money.GetList(where, "Time_add desc", PageSize, page);
            int recordCount = B_Lebi_Agent_Money.Counts(where);

            PageString = Pager.GetPaginationString("?page={0}&status=" + status + "&type=" + type + "&dateFrom=" + dateFrom + "&dateTo=" + dateTo + "&key=" + key + "&supplier_id=" + supplier_id + "&user_id=" + user_id, page, PageSize, recordCount);
        }