public static void Process(IHttpRequest Request, IHttpResponse Response) { bool value = false; string message = "Fail!"; XElement result = new XElement("Result"); int total = 0; try { int page = int.Parse(Request.Uri.QueryString["page"]); int size = int.Parse(Request.Uri.QueryString["size"]); int order = int.Parse(Request.Uri.QueryString["order"]); int consortiaID = int.Parse(Request.Uri.QueryString["consortiaID"]); int dutyID = int.Parse(Request.Uri.QueryString["dutyID"]); using (ConsortiaBussiness db = new ConsortiaBussiness()) { ConsortiaDutyInfo[] infos = db.GetConsortiaDutyPage(page, size, ref total, order, consortiaID, dutyID); ConsortiaDutyInfo[] array = infos; for (int i = 0; i < array.Length; i++) { ConsortiaDutyInfo info = array[i]; result.Add(FlashUtils.CreateConsortiaDutyInfo(info)); } value = true; message = "Success!"; } } catch (Exception ex) { } result.Add(new XAttribute("total", total)); result.Add(new XAttribute("vaule", value)); result.Add(new XAttribute("message", message)); Response.Write(result.ToString(false)); }
public void ProcessRequest(HttpContext context) { bool value = false; string message = "Fail!"; XElement result = new XElement("Result"); int total = 0; try { int page = int.Parse(context.Request["page"]); int size = int.Parse(context.Request["size"]); int order = int.Parse(context.Request["order"]); int consortiaID = int.Parse(context.Request["consortiaID"]); int dutyID = int.Parse(context.Request["dutyID"]); using (ConsortiaBussiness db = new ConsortiaBussiness()) { ConsortiaDutyInfo[] infos = db.GetConsortiaDutyPage(page, size, ref total, order, consortiaID, dutyID); foreach (ConsortiaDutyInfo info in infos) { result.Add(FlashUtils.CreateConsortiaDutyInfo(info)); } value = true; message = "Success!"; } } catch (Exception ex) { log.Error("ConsortiaDutyList", ex); } result.Add(new XAttribute("total", total)); result.Add(new XAttribute("vaule", value)); result.Add(new XAttribute("message", message)); context.Response.ContentType = "text/plain"; context.Response.Write(result.ToString(false)); }