Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                context.Response.ContentType = "text/plain";
                int PageSize    = Convert.ToInt32(context.Request.Params["pagesize"]);
                int currentpage = Convert.ToInt32(context.Request.Params["page"]);

                string      sWhere = "";
                WhereFilter QF     = null;
                //条件
                if (context.Request.Params["where"] != null)
                {
                    QF = new JavaScriptSerializer().Deserialize <WhereFilter>(context.Request.Params["where"]);
                    //sWhere = QF.GetWhere();
                }
                //排序
                if (context.Request.Params["sortorder"] != null)
                {
                    string sortname  = context.Request.Params["sortname"];
                    string sortorder = context.Request.Params["sortorder"];
                    sWhere += " order by " + sortname + " " + sortorder;
                }


                M_Data_Paging <M_CustomerInfo> lstMCusPage = SQLDBHelper.CreateDBClass <M_CustomerInfo_DB>().Query(QF, (currentpage - 1) * PageSize, currentpage * PageSize);
                //分页
                var    griddata = new { Rows = lstMCusPage.lstTObj, Total = lstMCusPage.RowCount };
                string str      = new JavaScriptSerializer().Serialize(griddata);
                context.Response.Write(str);
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                context.Response.ContentType = "text/plain";
                int PageSize    = Convert.ToInt32(context.Request.Params["pagesize"]);
                int currentpage = Convert.ToInt32(context.Request.Params["page"]);

                string      sWhere = "";
                WhereFilter QF     = null;
                //条件
                if (context.Request.Params["where"] != null)
                {
                    QF = new JavaScriptSerializer().Deserialize <WhereFilter>(context.Request.Params["where"]);
                    //sWhere = QF.GetWhere();
                }
                //排序
                if (context.Request.Params["sortorder"] != null)
                {
                    string sortname  = context.Request.Params["sortname"];
                    string sortorder = context.Request.Params["sortorder"];
                    sWhere += " order by " + sortname + " " + sortorder;
                }

                //M_User m = new M_User
                //{
                //    UserID = "a",
                //    UserName = "******",
                //    UserPwd = "s",
                //    UserPermission = "1,2",
                //    UserState = 1,
                //    Remark = "abc",
                //};

                //bool i = SQLDBHelper.CreateDBClass<M_User_DB>().Add(m);

                M_Data_Paging <M_User> lstMUserPage = SQLDBHelper.CreateDBClass <M_User_DB>().Query(QF, (currentpage - 1) * PageSize, currentpage * PageSize);
                //分页
                var    griddata = new { Rows = lstMUserPage.lstTObj, Total = lstMUserPage.RowCount };
                string str      = new JavaScriptSerializer().Serialize(griddata);
                context.Response.Write(str);
            }
            catch (Exception ex)
            {
            }
        }
Пример #3
0
 public static M_CustomerInfo_DB CreateCus()
 {
     return(SQLDBHelper.CreateDBClass <M_CustomerInfo_DB>());
 }
Пример #4
0
 public static M_User_DB CreateUser()
 {
     return(SQLDBHelper.CreateDBClass <M_User_DB>());
 }