public void SetUserAndInfo(HttpContext context) { HttpRequest Request = context.Request; string user = RequestHelper.string_transfer(Request, "user"); string info = RequestHelper.string_transfer(Request, "info"); string UniqueNo = RequestHelper.string_transfer(Request, "UniqueNo"); string Major_ID = Constant.UserInfo_List.Where(a => a.UniqueNo == UniqueNo).FirstOrDefault().Major_ID; string classid = Constant.Class_StudentInfo_List.Where(a => a.UniqueNo == UniqueNo).FirstOrDefault().Class_Id; //获取院系名称和班级名称 Major Major = Constant.Major_List.Where(a => a.Id == Major_ID).FirstOrDefault(); string Major_Name = Major == null ? "" : Major.Major_Name; ClassInfo Class_ = Constant.ClassInfo_List.Where(a => a.ClassNO == classid).FirstOrDefault(); int intSuccess = (int)errNum.Success; string Class_Name = Class_ == null ? null : Class_.Class_Name; UM um = new UM(); um.username = user; info = context.Server.UrlDecode(info); um.userinfo = info; um.department = Major_Name; um.class_ = Class_Name; um.time = DateTime.Now.ToShortDateString();; um.id = Guid.NewGuid().ToString(); um.state = "未读"; CONNECT_POOL1.Add(um); jsonModel = JsonModel.get_jsonmodel(intSuccess, "success", CONNECT_POOL1); context.Response.Write("{\"result\":" + Constant.jss.Serialize(jsonModel) + "}"); }
//SetInfoRead public void SetInfoRead(HttpContext context) { HttpRequest Request = context.Request; int intSuccess = (int)errNum.Success; string id = RequestHelper.string_transfer(Request, "id"); UM um = CONNECT_POOL1.Where(i => i.id == id).FirstOrDefault(); um.state = "已读"; jsonModel = JsonModel.get_jsonmodel(intSuccess, "success", CONNECT_POOL1); context.Response.Write("{\"result\":" + Constant.jss.Serialize(jsonModel) + "}"); }