public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; string ids = context.Request["id"]; //delete from xxxx where id in(xx,xx,xx) News.BLL.HKSJ_Main bllMain = new News.BLL.HKSJ_Main(); bllMain.DeleteList(ids); context.Response.Write("ok"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/html"; //获取页数据 int pageIndex = int.Parse(context.Request["pageIndex"]??"1"); int pageSize = int.Parse(context.Request["pageSize"] ?? "10"); int totalListCount = 0; //获得传输的数据 News.BLL.HKSJ_Main bllMain = new News.BLL.HKSJ_Main(); var newsList= bllMain.MyGetListByPage(pageSize, pageIndex,out totalListCount); string navString = NavPager.ShowPageNavigate(pageSize, pageIndex, totalListCount); var responseData = new { newsList = newsList, NavString = navString }; //返回 System.Web.Script.Serialization.JavaScriptSerializer jsSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); context.Response.Write(jsSerializer.Serialize(responseData)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; News.Model.HKSJ_Main modelMain = new News.Model.HKSJ_Main(); modelMain.people = context.Request["txtPeople"]; modelMain.title = context.Request["txtTitle"]; modelMain.content = context.Request["txtContent"]; modelMain.Date = DateTime.Now; modelMain.picUrl = string.Empty; modelMain.type = string.Empty; News.BLL.HKSJ_Main BllMain = new News.BLL.HKSJ_Main(); if (BllMain.Add(modelMain) > 0) { context.Response.Write("ok"); } else { context.Response.Write("error"); } }