Ejemplo n.º 1
0
        public IEnumerable <T> QryUsers <T>(Dictionary <string, object> paras, out int iCount)
        {
            iCount = 0;
            WhereBuilder builder = new WhereBuilder();

            builder.FromSql = "v_user_list";
            GridData grid = new GridData()
            {
                PageIndex     = Convert.ToInt32(paras["pi"]),
                PageSize      = Convert.ToInt32(paras["pageSize"]),
                SortField     = paras["sort"].ToString(),
                SortDirection = paras["order"].ToString()
            };

            builder.AddWhereAndParameter(paras, "userAn", "UserAccountName", "LIKE", "'%'+@userAn+'%'");
            //builder.AddWhereAndParameter(paras, "username", "RealName", "LIKE", "'%'+@username+'%'");
            //builder.AddWhereAndParameter(paras, "IsAble");
            //builder.AddWhereAndParameter(paras, "IfChangePwd");
            //builder.AddWhereAndParameter(paras, "RoleID");
            //builder.AddWhereAndParameter(paras, "adddatestart", "CreateTime", ">");
            //builder.AddWhereAndParameter(paras, "adddateend", "CreateTime", "<");
            return(SortAndPage <T>(builder, grid, out iCount));
        }
Ejemplo n.º 2
0
        public string QryDayForms(Dictionary <string, object> paras, out int iCount)
        {
            WhereBuilder builder = new WhereBuilder();

            builder.FromSql = "v_order_list";
            GridData grid = new GridData()
            {
                PageIndex     = Convert.ToInt32(paras["pi"]),
                PageSize      = Convert.ToInt32(paras["pageSize"]),
                SortField     = paras["sort"].ToString(),
                SortDirection = paras["order"].ToString()
            };
            int pageSize = Convert.ToInt32(paras["pageSize"]);
            int page     = Convert.ToInt32(paras["pi"]);

            builder.AddWhereAndParameter(paras, "day", "convert(varchar(10),OrderDate, 120)");
            builder.AddWhereAndParameter(paras, "agent_AN", "AgentAccountName", "LIKE", "'%'+@agent_AN+'%'");
            builder.AddWhereAndParameter(paras, "VipAccountName", "LIKE", "'%'+@vip_AN+'%'");
            var    s       = SortAndPage(builder, grid, out iCount);
            string retData = JsonConvert.SerializeObject(new { total = (int)Math.Ceiling((double)iCount / pageSize), rows = s, page = page });

            return(retData);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 作者:曾贤鑫
        /// 创建时间:2019-5-10
        /// 修改时间:2019-
        /// 功能:查询日期内的记录
        /// </summary>
        public string QryDayRechargeForm(Dictionary <string, object> paras, out int iCount)
        {
            WhereBuilder builder = new WhereBuilder();

            builder.FromSql = "tbrecharge";
            GridData grid = new GridData()
            {
                PageIndex     = Convert.ToInt32(paras["pi"]),
                PageSize      = Convert.ToInt32(paras["pageSize"]),
                SortField     = paras["sort"].ToString(),
                SortDirection = paras["order"].ToString()
            };
            int pageSize = Convert.ToInt32(paras["pageSize"]);
            int page     = Convert.ToInt32(paras["pi"]);

            builder.AddWhereAndParameter(paras, "day", "convert(varchar(10),recharge_time, 120)", "like", "@day+'%'");
            builder.AddWhereAndParameter(paras, "agent_AN");
            builder.AddWhereAndParameter(paras, "vip_AN");
            var    s       = SortAndPage(builder, grid, out iCount);
            string retData = JsonConvert.SerializeObject(new { total = (int)Math.Ceiling((double)iCount / pageSize), rows = s, page = page });

            return(retData);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 查询所有的代理商商品
        /// </summary>
        /// <param name="paras"></param>
        /// <returns></returns>
        public string QryAgoods(Dictionary <string, object> paras, out int iCount)
        {
            WhereBuilder builder = new WhereBuilder();

            builder.FromSql = "tbAgoods a join tbgoods b on a.goods_id = b.id";
            GridData grid = new GridData()
            {
                PageIndex     = Convert.ToInt32(paras["pi"]),
                PageSize      = Convert.ToInt32(paras["pageSize"]),
                SortField     = paras["sort"].ToString(),
                SortDirection = paras["order"].ToString()
            };

            builder.AddWhereAndParameter(paras, "goods_Name", "a.goods_Name", "LIKE", "'%'+@goods_Name+'%'");
            builder.AddWhereAndParameter(paras, "agent_AN");
            builder.AddWhereAndParameter(paras, "status_id");
            builder.AddWhereAndParameter(paras, "type_id");

            var    s       = SortAndPage(builder, grid, out iCount, "a.*,b.goods_intro,b.goods_pic");
            string retData = JsonConvert.SerializeObject(new { total = iCount, rows = s });

            return(retData);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 查询会员,分页
        /// </summary>
        /// <param name="paras"></param>
        /// <returns></returns>
        public string QryAllVIP(Dictionary <string, object> paras, out int iCount)
        {
            WhereBuilder builder = new WhereBuilder();

            builder.FromSql = "tbvip";
            GridData grid = new GridData()
            {
                PageIndex = Convert.ToInt32(paras["pi"]),
                PageSize  = Convert.ToInt32(paras["pageSize"]),
                SortField = paras["sort"].ToString()
            };

            builder.AddWhereAndParameter(paras, "vip_AN", "vip_AN", "LIKE", "'%'+@vip_AN+'%'");

            builder.AddWhereAndParameter(paras, "vip_mp");
            builder.AddWhereAndParameter(paras, "vip_Email", "vip_Email", "LIKE", "'%'+@vip_Email+'%'");
            builder.AddWhereAndParameter(paras, "status_id");
            builder.AddWhereAndParameter(paras, "agent_id");

            var    s       = SortAndPage(builder, grid, out iCount);
            string retData = JsonConvert.SerializeObject(new { total = iCount, rows = s });

            return(retData);
        }