protected void Page_Load(object sender, EventArgs e) { according = RequestData.Get <string>("According"); createId = RequestData.Get <string>("CreateId"); messageType = Server.UrlDecode(RequestData.Get <string>("MessageType")); id = RequestData.Get <string>("id"); msgContent = Server.UrlDecode(RequestData.Get <string>("MessageContent")); receiverId = RequestData.Get <string>("ReceiverId"); if (!string.IsNullOrEmpty(id)) { ent = IntegratedMessage.Find(id); } switch (RequestActionString) { case "SignRead": ent.State = "1"; ent.DoUpdate(); break; case "Delete": ent.State = "2"; ent.DoUpdate(); break; case "SendMessage": ent = new IntegratedMessage(); ent.ReceiverId = receiverId; ent.ReceiverName = SysUser.Find(receiverId).Name; ent.MessageType = "一般消息"; ent.MessageContent = msgContent; ent.SubmitState = "1"; ent.DoCreate(); break; default: DoSelect(); break; } }
protected void Page_Load(object sender, EventArgs e) { userId = RequestData.Get <string>("UserId"); id = RequestData.Get <string>("id"); Action = RequestData.Get <string>("Action"); deptId = RequestData.Get <string>("DeptId"); switch (RequestActionString) { case "ImportFile": string fileIds = RequestData.Get <string>("fileIds"); if (!string.IsNullOrEmpty(fileIds)) { sql = @"select * from BJKY_Portal..FileItem where PatIndex('%'+Id+'%','{0}')>0"; sql = string.Format(sql, fileIds); PageState.Add("Result", DataHelper.QueryDictList(sql)); } break; case "AddUser": IList <string> userIds = RequestData.GetList <string>("UserIds"); string struserIds = ""; for (int i = 0; i < userIds.Count; i++) { struserIds += userIds[i] + ","; } sql = @"select UserId,Name as UserName,(select top 1 GroupName from BJKY_Examine..PersonConfig where (PatIndex('%'+UserId+'%',FirstLeaderIds)>0 or PatIndex('%'+UserId+'%',SecondLeaderIds)>0 or PatIndex('%'+UserId+'%',ClerkIds)>0) and GroupType in ('经营目标单位','职能服务部门')) as DeptName from BJKY_Portal..SysUser where PatIndex('%'+UserId+'%','{0}')>0"; sql = string.Format(sql, struserIds); PageState.Add("Users", DataHelper.QueryDictList(sql)); break; case "update": ent = GetMergedData <IntegratedMessage>(); if (Action == "Send") { string[] userIdArray = ent.ReceiverIds.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); string[] userNameArray = ent.ReceiverNames.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < userIdArray.Length; i++) { IntegratedMessage imEnt = new IntegratedMessage(); imEnt.ReceiverId = userIdArray[i]; imEnt.ReceiverName = userNameArray[i]; imEnt.MessageType = ent.MessageType; imEnt.MessageContent = ent.MessageContent; imEnt.Attachment = ent.Attachment; imEnt.ShortMessage = ent.ShortMessage; imEnt.Mail = ent.Mail; imEnt.SubmitState = "1"; imEnt.DoCreate(); } ent.DoDelete(); } else { ent.DoUpdate(); } break; case "create": ent = GetPostedData <IntegratedMessage>(); ent.DoCreate(); if (Action == "Send") { string[] userIdArray = ent.ReceiverIds.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); string[] userNameArray = ent.ReceiverNames.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < userIdArray.Length; i++) { IntegratedMessage imEnt = new IntegratedMessage(); imEnt.ReceiverId = userIdArray[i]; imEnt.ReceiverName = userNameArray[i]; imEnt.MessageType = ent.MessageType; imEnt.MessageContent = ent.MessageContent; imEnt.Attachment = ent.Attachment; imEnt.ShortMessage = ent.ShortMessage; imEnt.Mail = ent.Mail; imEnt.SubmitState = "1"; imEnt.DoCreate(); } ent.DoDelete(); } break; default: DoSelect(); break; } }