protected void Page_Load(object sender, EventArgs e) { int id = Int32.Parse(Request["id"]); BLL.LvYouJingDianXinXi lvYouJingDian = new BLL.LvYouJingDianXinXi(); model = lvYouJingDian.GetModel(id); }
public void ProcessRequest(HttpContext context) { //当添加成功后,用户点击查看信息,获得刚添加进去的ID context.Response.ContentType = "text/plain"; string type = context.Request["type"]; switch (type) { case "guihua": BLL.LvYouGuiHuaXinXi guihua = new BLL.LvYouGuiHuaXinXi(); Dt = guihua.GetList1(""); break; case "gongkaixinxi": BLL.GongKaiXinXi gongKaiXinXi = new BLL.GongKaiXinXi(); Dt = gongKaiXinXi.GetList1(""); break; case "jingdian": BLL.LvYouJingDianXinXi tt = new BLL.LvYouJingDianXinXi(); Dt = tt.GetList1(""); break; //可拓展 //。。。。。 } int rowIndex = Dt.Tables[0].Rows.Count; string id = Dt.Tables[0].Rows[rowIndex - 1][0].ToString(); context.Response.Write(id); }
public void ProcessRequest(HttpContext context) { context.Response.AppendHeader("Access-Control-Allow-Origin", "*"); context.Response.AppendHeader("Content-type", "application/json"); BLL.LvYouJingDianXinXi model = new BLL.LvYouJingDianXinXi(); var list = model.GetModelList(""); string jsonstr = new JavaScriptSerializer().Serialize(list); context.Response.Write(jsonstr); }
public void ProcessRequest(HttpContext context) { BLL.LvYouJingDianXinXi mainService = new BLL.LvYouJingDianXinXi(); list = mainService.GetModelList(""); int count = list.Count(); var jsonstr1 = new { jingdianList = list, jingdianCount = count }; string jsonstr = new JavaScriptSerializer().Serialize(jsonstr1); context.Response.Write(jsonstr); }
public void ProcessRequest(HttpContext context) { context.Response.AppendHeader("Access-Control-Allow-Origin", "*"); context.Response.AppendHeader("Content-type", "application/json"); context.Response.ContentType = "text/plain"; string sid = context.Request["id"].ToString(); int id = Int32.Parse(sid); BLL.LvYouJingDianXinXi gongKaiXinXi = new BLL.LvYouJingDianXinXi(); var data = gongKaiXinXi.GetModel(id); string jsondata = new JavaScriptSerializer().Serialize(data); context.Response.Write(jsondata); }
protected void Page_Load(object sender, EventArgs e) { int pageIndex = int.Parse(Request["pageIndex"] ?? "1"); pageindex = pageIndex; int pageSize = 5; BLL.LvYouJingDianXinXi mainService = new BLL.LvYouJingDianXinXi(); var ds = mainService.GetListByPage(string.Empty, " ", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex); //取当前页的数据 list = mainService.DataTableToList(ds.Tables[0]); //设置一共多少页 var allCount = mainService.GetRecordCount(string.Empty); DataCount = allCount; PageCount = Math.Max((allCount + pageSize - 1) / pageSize, 1); //生成 分页的标签 Navstring = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, allCount); }
protected void Serachwithcondition_Click(object sender, EventArgs e) { BLL.LvYouJingDianXinXi mainService = new BLL.LvYouJingDianXinXi(); string firsttype = select2.Items[select2.SelectedIndex].Value; string secondtype = Request["condition"];//根据name属性获取 if (secondtype == "") { int pageIndex = int.Parse(Request["pageIndex"] ?? "1"); pageindex = pageIndex; int pageSize = 5; var ds = mainService.GetListByPage(string.Empty, " ", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex); list = mainService.DataTableToList(ds.Tables[0]); var allCount = mainService.GetRecordCount(string.Empty); DataCount = allCount; PageCount = Math.Max((allCount + pageSize - 1) / pageSize, 1); Navstring = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, allCount); } else { int pageIndex = 1; pageindex = pageIndex; int allCount = 0; int pageSize = 0; string combinestr = firsttype + "|" + secondtype; pageSize = 1000; var ds = mainService.GetListByPage(combinestr, " ", (pageIndex - 1) * pageSize + 1, pageSize * pageIndex); list = mainService.DataTableToList(ds.Tables[0]); allCount = mainService.GetRecordCount(combinestr); DataCount = allCount; if (DataCount == 0) { showinfo = "没有数据!"; } PageCount = 1; PreSerach = secondtype; Navstring = Common.LaomaPager.ShowPageNavigate(pageSize, pageIndex, allCount); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string str = context.Request["str"]; string action = context.Request["action"]; if (str.Substring(0, 1) == ",") { str = str.Substring(1, str.Length - 2); } else { str = str.Substring(0, str.Length - 1); } switch (action) { case "guihua": BLL.LvYouGuiHuaXinXi guihua = new BLL.LvYouGuiHuaXinXi(); guihua.DeleteList(str); break; case "xinxi": BLL.GongKaiXinXi gongKaiXinXi = new BLL.GongKaiXinXi(); gongKaiXinXi.DeleteList(str); break; case "jingdian": BLL.LvYouJingDianXinXi LvYouJingDianXinXi = new BLL.LvYouJingDianXinXi(); LvYouJingDianXinXi.DeleteList(str); break; case "liuyan": BLL.LiuYanBan liuYanBan = new BLL.LiuYanBan(); liuYanBan.DeleteList(str); break; } context.Response.Write("ok"); }