protected string getCCWorkList() { UserLogInfo userLoginInfo = this.LogInfo; TSysUserVo user = userLoginInfo.UserInfo; IList <string[]> queryParams = new List <string[]>(); if (!string.IsNullOrEmpty(Request["flowName"])) { queryParams.Add(new string[3] { "FlowName", Request["flowName"], "like" }); } if (!string.IsNullOrEmpty(Request["CDTStart"])) { queryParams.Add(new string[3] { "CDT", Request["CDTStart"], "ge" }); } if (!string.IsNullOrEmpty(Request["CDTEnd"])) { queryParams.Add(new string[3] { "CDT", Request["CDTEnd"], "le" }); } if (!string.IsNullOrEmpty(Request["ddlType"])) { if (Request["ddlType"] == "未读") { queryParams.Add(new string[3] { "Sta", "0", "eq" }); } else { queryParams.Add(new string[3] { "Sta", "0", "neq" }); } } if (!string.IsNullOrEmpty(Request["CCTo"])) { queryParams.Add(new string[3] { "CCToName", Request["CCTo"], "like" }); } if (!string.IsNullOrEmpty(Request["FK_Node"])) { queryParams.Add(new string[3] { "FK_Node", Request["FK_Node"], "eq" }); } int?page = null; int?pageSize = null; if (!string.IsNullOrEmpty(Request["page"])) { page = Convert.ToInt32(Request["page"]); } if (!string.IsNullOrEmpty(Request["pagesize"])) { pageSize = Convert.ToInt32(Request["pagesize"]); } var isAllUser = false; if (!string.IsNullOrEmpty(Request["mode"]) && Request["mode"] == "Statistics") { isAllUser = true; } string info = CCFlowFacade.GetCC(user.USER_NAME, queryParams.ToArray(), page, pageSize, isAllUser); XmlDocument document = new XmlDocument(); document.LoadXml(info); XmlNodeList rows = document.SelectNodes("/root/record/row"); XmlNode nodeCount = document.SelectSingleNode("/root/count"); string total = nodeCount.InnerText; IList <Dictionary <string, string> > list = new List <Dictionary <string, string> >(); for (int i = 0; i < rows.Count; i++) { XmlNode node = rows.Item(i); XmlNodeList children = node.ChildNodes; Dictionary <string, string> dic = new Dictionary <string, string>(); for (int j = 0; j < children.Count; j++) { XmlNode element = children[j]; dic.Add(element.Name, Server.UrlDecode(element.InnerText)); } list.Add(dic); } JavaScriptSerializer serializer = new JavaScriptSerializer(); if (page == null || pageSize == null) { return(serializer.Serialize(new { Rows = list })); } else { return(serializer.Serialize(new { Total = total, Rows = list })); } }
protected string SampleQcCheckCount = "0"; //现场室主任审核 #endregion protected void Page_Load(object sender, EventArgs e) { this.Hidden1.Value = ConfigurationManager.AppSettings["Welcome"]; ShowData(); if (Request["GetCCFlow"] == "GetCCFlow") { var works = CCFlowFacade.GetEmpWorks(this.LogInfo.UserInfo.USER_NAME, new string[][] { }, null, null); var xe = XElement.Parse(works).Element("record").Elements(); var group = from p in xe where !Server.UrlDecode(p.Element("AtPara").Value).Contains("IsCC=1") group p by p.Element("FK_Node").Value into grps select new { FK_Node = grps.Key, Total = grps.Count(), NodeName = Server.UrlDecode(grps.First().Element("NodeName").Value) }; JavaScriptSerializer serializer = new JavaScriptSerializer(); var result = serializer.Serialize(group); Response.Write(result); Response.End(); } if (Request["GetCCFlow"] == "GetCCFlowBatch") { var works = CCFlowFacade.GetBatchWorks(this.LogInfo.UserInfo.USER_NAME); var xe = XElement.Parse(works).Element("record").Elements(); var group = from p in xe select new { FK_Node = p.Element("NodeID").Value, NUM = p.Element("NUM").Value, NodeName = Server.UrlDecode(p.Element("Name").Value) }; JavaScriptSerializer serializer = new JavaScriptSerializer(); var result = serializer.Serialize(group); Response.Write(result); Response.End(); } if (Request["GetCCFlow"] == "GetCCFlowCC") { //待办中的抄送 var works = CCFlowFacade.GetEmpWorks(this.LogInfo.UserInfo.USER_NAME, new string[][] { }, null, null); var xe = XElement.Parse(works).Element("record").Elements().Where(t => Server.UrlDecode(t.Element("AtPara").Value).Contains("IsCC=1")); //抄送 var queryParams = new List <string[]>(); queryParams.Add(new string[3] { "Sta", "0", "eq" }); var ccWorks = CCFlowFacade.GetCC(this.LogInfo.UserInfo.USER_NAME, queryParams.ToArray(), null, null); var inWorks = xe.Select(t => t.Element("WorkID").Value + t.Element("FK_Node").Value + t.Element("FK_Emp").Value); var ccXE = XElement.Parse(ccWorks).Element("record").Elements() .Where(t => !inWorks.Contains(t.Element("WorkID").Value + t.Element("FK_Node").Value + t.Element("CCTo").Value)); var group = (from p in xe group p by p.Element("FK_Node").Value into grps select new { FK_Node = grps.Key, Total = grps.Count(), NodeName = Server.UrlDecode(grps.First().Element("NodeName").Value), IsToDo = true }).Union ( from p in ccXE group p by p.Element("FK_Node").Value into grps select new { FK_Node = grps.Key, Total = grps.Count(), NodeName = Server.UrlDecode(grps.First().Element("NodeName").Value), IsToDo = false } ); JavaScriptSerializer serializer = new JavaScriptSerializer(); var result = serializer.Serialize(group); Response.Write(result); Response.End(); } }