public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string type = context.Request.QueryString["type"]; DTcms.BLL.BarCodeCreateRecord bll = new DTcms.BLL.BarCodeCreateRecord(); if (type == "select") { int pageIndex = int.Parse(context.Request.Form["page"].ToString()); int pageSize = int.Parse(context.Request.Form["rows"].ToString()); string json = ""; try { int recordCount = 0; DataSet ds = bll.GetList(pageSize, pageIndex, "", "BarCodeCreateRecordID", out recordCount); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { IsoDateTimeConverter timeFormat = new IsoDateTimeConverter(); timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = JsonConvert.SerializeObject(ds.Tables[0], new DataTableConverter(), timeFormat); context.Response.Write("{\"total\":" + "\"" + recordCount + "\"" + ",\"rows\":" + json + "}"); } else { context.Response.Write("{\"total\":" + "\"0\"" + ",\"rows\":[]}"); } } catch (Exception) { } } if (type == "del") { bll.Delete(context.Request.QueryString["ids"]); } }
public void GetModel(int pageIndex) { DTcms.BLL.BarCodeCreateRecord bll = new DTcms.BLL.BarCodeCreateRecord(); //DTcms.BLL.GoodCategory bll2 = new DTcms.BLL.GoodCategory(); //List<DTcms.Model.BarCodeCreateRecord> bccs = bll.GetList(); //List<DTcms.Model.GoodCategory> bcs = bll2.GetModel(); //var a = from b in bccs // join c in bcs // on b.GoodCategoryID equals c.GoodCategoryID // where b.Show==1 // select new // { // b.BarCodeCreateRecordID,b.GoodCategoryID,b.RetrospectCode,c.GoodCategoryName,b.BoxSum,b.GoodCount,b.Operator,b.State,b.CreateTime,b.Remark,b.DownLoad // }; //drpresult.DataSource = a; //drpresult.DataBind(); //int recordCount = 0; //DataSet ds = bll.GetList(10, pageIndex, " b.Show=1", "BarCodeCreateRecordID", out recordCount); //drpresult.DataSource = ds.Tables[0]; //drpresult.DataBind(); }
protected void BtnOut_Click(object sender, EventArgs e) { DTcms.BLL.BarCodeCreateRecord bll = new DTcms.BLL.BarCodeCreateRecord(); bll.Delete(Request.Form["code"]); }