protected void DataInfoBind() { int total = 0; var list = bllAdmin.GetList(ShowPager.CurrentPageIndex, ShowPager.PageSize, ref total, p => true, p => p.ID, false); ShowPager.RecordCount = total; this.rpData.DataSource = list; this.rpData.DataBind(); }
public void dgvAdmin_Load() { Maticsoft.BLL.Admin adm = new BLL.Admin(); DataSet ds = new DataSet(); ds = adm.GetList(""); dgvAdmin.DataSource = ds.Tables[0]; ds.Tables[0].Columns["userID"].ColumnName = "用户名"; ds.Tables[0].Columns["userName"].ColumnName = "昵称"; ds.Tables[0].Columns["passwd"].ColumnMapping = MappingType.Hidden; dgvAdmin.AllowUserToAddRows = false; dgvAdmin.SelectionMode = DataGridViewSelectionMode.FullRowSelect; }
private void BindData() { string strFiter = string.Empty; if (ViewState["fiter"] != null) { strFiter = ViewState["fiter"].ToString(); } DataTable dt = blladmin.GetList(strFiter).Tables[0]; this.GridView1.DataSource = dt; this.GridView1.DataBind(); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string json = "{}"; string action = context.Request.Form["Action"]; if (action == "Show") { BLL.Admin bll = new BLL.Admin(); DataSet ds = bll.GetList(10); //调用业务逻辑层的方法 ds.Tables[0].TableName = "Admin"; //为数据表改名 //返回列表 json = WEB.DataConvertJson.DataTable2Json(ds.Tables[0]); //调用把datatable转为json的方法 } context.Response.Write(json); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string json = "{}"; string action = context.Request.Form["Action"]; if (action == "Show") { BLL.Admin bll = new BLL.Admin(); DataSet ds = bll.GetList(20); //调用业务逻辑层的方法 ds.Tables[0].TableName = "Admin"; //为数据表改名 //返回列表 json = WEB.DataConvertJson.DataTable2Json(ds.Tables[0]); //调用把datatable转为json的方法 context.Response.Write(json); } else if (action == "Load")//检查是否已经登录 { if (context.Session["ID"] == null) { json = "{'info':'no'}"; } context.Response.Write(json); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string json = ""; string action = context.Request.Form["Action"]; if (action == "Show")//显示 { if (context.Session["ID"] == null) { json = "{}";//未登录 } else { BLL.Admin bll = new BLL.Admin(); DataSet ds = bll.GetList(""); ds.Tables[0].TableName = "AdminTable"; //返回列表 json = WEB.DataConvertJson.DataTable2Json(ds.Tables[0]); } } else if (action == "Del") //删除操作 { string DelNumS = context.Request.Form["DelNumS"]; //获取批量删除的编号 BLL.Admin bll = new BLL.Admin(); if (bll.DeleteList(DelNumS)) { json = "{'info':'删除成功'}"; } else { json = "{'info':'删除失败'}"; } } context.Response.Write(json); }