public void ProcessRequest(HttpContext context) { bool value = false; string message = "Fail!"; int total = 0; XElement result = new XElement("Result"); try { int id = int.Parse(context.Request["id"]); using (ConsortiaBussiness db = new ConsortiaBussiness()) { ConsortiaInfo info = db.GetConsortiaSingle(id); if (info != null) { result.Add(new XAttribute("Level", info.Level)); result.Add(new XAttribute("Repute", info.Repute)); } } using (ConsortiaBussiness db = new ConsortiaBussiness()) { ConsortiaUserInfo[] infos = db.GetConsortiaUsersPage(1, 1000, ref total, -1, id, -1, -1); foreach (ConsortiaUserInfo info in infos) { result.Add(FlashUtils.CreateConsortiaIMInfo(info)); } value = true; message = "Success!"; } } catch (Exception ex) { log.Error("ConsortiaIMList", ex); } result.Add(new XAttribute("value", value)); result.Add(new XAttribute("message", message)); context.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 userID = int.Parse(context.Request["userID"]); int state = int.Parse(context.Request["state"]); using (ConsortiaBussiness db = new ConsortiaBussiness()) { ConsortiaUserInfo[] infos = db.GetConsortiaUsersPage(page, size, ref total, order, consortiaID, userID, state); foreach (ConsortiaUserInfo info in infos) { result.Add(FlashUtils.CreateConsortiaUserInfo(info)); } value = true; message = "Success!"; } } catch (Exception ex) { log.Error("ConsortiaUsersList", ex); } result.Add(new XAttribute("total", total)); result.Add(new XAttribute("value", value)); result.Add(new XAttribute("message", message)); result.Add(new XAttribute("currentDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))); context.Response.ContentType = "text/plain"; context.Response.Write(result.ToString(false)); }
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 userID = int.Parse(Request.Uri.QueryString["userID"]); int state = int.Parse(Request.Uri.QueryString["state"]); using (ConsortiaBussiness db = new ConsortiaBussiness()) { ConsortiaUserInfo[] infos = db.GetConsortiaUsersPage(page, size, ref total, order, consortiaID, userID, state); ConsortiaUserInfo[] array = infos; for (int i = 0; i < array.Length; i++) { ConsortiaUserInfo info = array[i]; result.Add(FlashUtils.CreateConsortiaUserInfo(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)); result.Add(new XAttribute("currentDate", DateTime.Now.ToString())); Response.Write(result.ToString(false)); }