public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //context.Response.Write("Hello World"); string classID, className, classDesc; classID = context.Request["classID"].ToString(); className = context.Request["className"].ToString(); classDesc = context.Request["classDesc"].ToString(); BLL.ClassInfo classServer = new BLL.ClassInfo(); Model.ClassInfo classObj = new Model.ClassInfo(); classObj.classDesc = classDesc; classObj.className = className; classObj.classID = classID; bool isSuccess = classServer.Add(classObj); if (isSuccess) { context.Response.Write("ok"); } else { context.Response.Write("不ok"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //context.Response.Write("Hello World"); string id = context.Request["classID"].ToString(); BLL.ClassInfo classServer = new BLL.ClassInfo(); Model.ClassInfo classObj = classServer.GetModel(id); string json = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(classObj); context.Response.Write(json); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //context.Response.Write("Hello World"); string classID = context.Request["classID"].ToString(); BLL.ClassInfo classServer = new BLL.ClassInfo(); bool isSuccess = classServer.Delete(classID); if (isSuccess) { context.Response.Write("ok"); } else { context.Response.Write("不ok"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; //context.Response.Write("Hello World"); List <Model.ClassInfo> classList = new List <Model.ClassInfo>(); BLL.ClassInfo classServer = new BLL.ClassInfo(); //int pageIndex= int.Parse(context.Request["pageIndex"]); //int pageSize = 12; //int totalCount = classServer.GetRecordCount(string.Empty); //string pagination = CreatePagination.ShowPageNavigate(pageSize,pageIndex,totalCount); int count = classServer.GetRecordCount(string.Empty); var classDataSet = classServer.GetListByPage(string.Empty, "classID", 1, 30); //var classDataSet = classServer.GetListByPage(string.Empty,"ClassId",1,20); classList = classServer.DataTableToList(classDataSet.Tables[0]); string json = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(classList); context.Response.Write(json); }