public string Query() { List <RoadFlow.Data.Model.WorkFlow> workFlowList = new List <RoadFlow.Data.Model.WorkFlow>(); RoadFlow.Platform.Users users = new RoadFlow.Platform.Users(); RoadFlow.Platform.WorkFlow workFlow1 = new RoadFlow.Platform.WorkFlow(); string name = this.Request.Form["flow_name"]; string str1 = this.Request.Form["typeid"]; string str2 = this.Request.Form["sidx"]; string str3 = this.Request.Form["sord"]; bool flag = "1" == this.Request.Form["openlist"]; string typeid = ""; if (str1.IsGuid()) { typeid = new RoadFlow.Platform.Dictionary().GetAllChildsIDString(str1.ToGuid(), true); } int pageSize = flag ? 10 : RoadFlow.Utility.Tools.GetPageSize(); int pageNumber = RoadFlow.Utility.Tools.GetPageNumber(); string order = (str2.IsNullOrEmpty() ? "CreateDate" : str2) + " " + (str3.IsNullOrEmpty() ? "asc" : str3); long count; List <RoadFlow.Data.Model.WorkFlow> pagerData = workFlow1.GetPagerData(out count, pageSize, pageNumber, RoadFlow.Platform.Users.CurrentUserID.ToString(), typeid, name, order); JsonData jsonData1 = new JsonData(); foreach (RoadFlow.Data.Model.WorkFlow workFlow2 in pagerData) { JsonData jsonData2 = new JsonData(); jsonData2["id"] = (JsonData)workFlow2.ID.ToString(); jsonData2["Name"] = (JsonData)workFlow2.Name; jsonData2["CreateDate"] = (JsonData)workFlow2.CreateDate.ToDateTimeString(); jsonData2["CreateUserID"] = (JsonData)users.GetName(workFlow2.CreateUserID); jsonData2["Status"] = (JsonData)workFlow1.GetStatusTitle(workFlow2.Status); if (flag) { jsonData2["Edit"] = (JsonData)("<a href=\"javascript:void(0);\" onclick=\"openflow('" + (object)workFlow2.ID + "');return false;\"><img src=\"" + this.Url.Content("~/Images/ico/topic_edit.gif") + "\" alt=\"\" style=\"vertical-align:middle; border:0;\" /><span style=\"vertical-align:middle; margin-left:3px;\">编辑</span></a>"); } else { jsonData2["Edit"] = (JsonData)("<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"openflow('" + (object)workFlow2.ID + "','" + workFlow2.Name + "');return false;\"><span style=\"vertical-align:middle;\">编辑</span></a><a class=\"deletelink\" href=\"javascript:void(0);\" style=\"margin-left:5px\" onclick=\"delflow('" + (object)workFlow2.ID + "'); return false;\"><span style=\"vertical-align:middle;\">删除</span></a><a href=\"javascript:void(0);\" style=\"margin-left:5px\" onclick=\"ExportFlow('" + (object)workFlow2.ID + "'); return false;\"><span style=\"vertical-align:middle; background:url(../Images/ico/arrow_medium_right.png) no-repeat;padding-left:18px;\">导出</span></a>"); } jsonData1.Add((object)jsonData2); } return("{\"userdata\":{\"total\":" + (object)count + ",\"pagesize\":" + (object)pageSize + ",\"pagenumber\":" + (object)pageNumber + "},\"rows\":" + jsonData1.ToJson(true) + "}"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string id = context.Request.QueryString["id"]; Guid gid; if (id.IsNullOrEmpty()) { context.Response.Write(""); } RoadFlow.Platform.Organize borg = new RoadFlow.Platform.Organize(); RoadFlow.Platform.Users buser = new RoadFlow.Platform.Users(); if (id.StartsWith(RoadFlow.Platform.Users.PREFIX)) { Guid uid = buser.RemovePrefix1(id).ToGuid(); context.Response.Write(string.Concat(borg.GetAllParentNames(buser.GetMainStation(uid)), " / ", buser.GetName(uid))); } else if (id.StartsWith(RoadFlow.Platform.WorkGroup.PREFIX)) { context.Response.Write(new RoadFlow.Platform.WorkGroup().GetUsersNames(RoadFlow.Platform.WorkGroup.RemovePrefix(id).ToGuid(), '、')); } else if (id.IsGuid(out gid)) { context.Response.Write(borg.GetAllParentNames(gid)); } context.Response.Write(""); }
public string GetNote() { string id = Request.QueryString["id"]; Guid gid; if (id.IsNullOrEmpty()) { return(""); } RoadFlow.Platform.Organize borg = new RoadFlow.Platform.Organize(); RoadFlow.Platform.Users buser = new RoadFlow.Platform.Users(); if (id.StartsWith(RoadFlow.Platform.Users.PREFIX)) { Guid uid = buser.RemovePrefix1(id).ToGuid(); return(string.Concat(borg.GetAllParentNames(buser.GetMainStation(uid)), " / ", buser.GetName(uid))); } else if (id.StartsWith(RoadFlow.Platform.WorkGroup.PREFIX)) { return(new RoadFlow.Platform.WorkGroup().GetUsersNames(RoadFlow.Platform.WorkGroup.RemovePrefix(id).ToGuid(), '、')); } else if (id.IsGuid(out gid)) { return(borg.GetAllParentNames(gid)); } return(""); }
public string Query() { RoadFlow.Platform.WorkFlowDelegation workFlowDelegation1 = new RoadFlow.Platform.WorkFlowDelegation(); RoadFlow.Platform.Organize organize = new RoadFlow.Platform.Organize(); RoadFlow.Platform.Users users = new RoadFlow.Platform.Users(); RoadFlow.Platform.WorkFlow workFlow1 = new RoadFlow.Platform.WorkFlow(); string startTime = this.Request.Form["S_StartTime"]; string endTime = this.Request.Form["S_EndTime"]; string id1 = this.Request.Form["S_UserID"]; string str1 = this.Request.Form["sidx"]; string str2 = this.Request.Form["sord"]; string str3 = this.Request.Form["typeid"]; int pageSize = Tools.GetPageSize(); int pageNumber = Tools.GetPageNumber(); string order = (str1.IsNullOrEmpty() ? "SenderTime" : str1) + " " + (str2.IsNullOrEmpty() ? "asc" : str2); long count; IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation> workFlowDelegations = !("1" == this.Request.QueryString["isoneself"]) ? (IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation>)workFlowDelegation1.GetPagerData(out count, pageSize, pageNumber, RoadFlow.Platform.Users.RemovePrefix(id1), startTime, endTime, order) : (IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation>)workFlowDelegation1.GetPagerData(out count, pageSize, pageNumber, MyController.CurrentUserID.ToString(), startTime, endTime, order); JsonData jsonData1 = new JsonData(); foreach (RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 in workFlowDelegations) { string str4 = "委托中"; if (workFlowDelegation2.StartTime > DateTimeNew.Now) { str4 = "未开始"; } else if (workFlowDelegation2.EndTime < DateTimeNew.Now) { str4 = "已失效"; } JsonData jsonData2 = new JsonData(); JsonData jsonData3 = jsonData2; string index1 = "id"; Guid id2 = workFlowDelegation2.ID; JsonData jsonData4 = (JsonData)id2.ToString(); jsonData3[index1] = jsonData4; jsonData2["UserID"] = (JsonData)users.GetName(workFlowDelegation2.UserID); jsonData2["ToUserID"] = (JsonData)users.GetName(workFlowDelegation2.ToUserID); JsonData jsonData5 = jsonData2; string index2 = "FlowID"; Guid? flowId = workFlowDelegation2.FlowID; string str5; if (!flowId.HasValue) { str5 = ""; } else { RoadFlow.Platform.WorkFlow workFlow2 = workFlow1; flowId = workFlowDelegation2.FlowID; Guid flowID = flowId.Value; str5 = workFlow2.GetFlowName(flowID); } JsonData jsonData6 = (JsonData)str5; jsonData5[index2] = jsonData6; jsonData2["StartTime"] = (JsonData)workFlowDelegation2.StartTime.ToDateTimeString(); jsonData2["EndTime"] = (JsonData)workFlowDelegation2.EndTime.ToDateTimeString(); jsonData2["Note"] = (JsonData)workFlowDelegation2.Note; jsonData2["Status"] = (JsonData)str4; JsonData jsonData7 = jsonData2; string index3 = "Edit"; string str6 = "<a class=\"editlink\" href=\"javascript:edit('"; id2 = workFlowDelegation2.ID; string str7 = id2.ToString(); string str8 = "');\">编辑</a>"; JsonData jsonData8 = (JsonData)(str6 + str7 + str8); jsonData7[index3] = jsonData8; jsonData1.Add((object)jsonData2); } return("{\"userdata\":{\"total\":" + (object)count + ",\"pagesize\":" + (object)pageSize + ",\"pagenumber\":" + (object)pageNumber + "},\"rows\":" + jsonData1.ToJson(true) + "}"); }