public ActionResult Index(FormCollection collection) { RoadFlow.Platform.WorkFlowDelegation bworkFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation(); RoadFlow.Platform.Organize borganize = new RoadFlow.Platform.Organize(); RoadFlow.Platform.UsersBLL busers = new RoadFlow.Platform.UsersBLL(); RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.Platform.WorkFlow(); IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation> workFlowDelegationList; string startTime = string.Empty; string endTime = string.Empty; string query1 = string.Format("&appid={0}&tabid={1}&isoneself={2}", Request.QueryString["appid"], Request.QueryString["tabid"], Request.QueryString["isoneself"]); if (collection != null) { if (!Request.Form["DeleteBut"].IsNullOrEmpty()) { string ids = Request.Form["checkbox_app"]; foreach (string id in ids.Split(',')) { Guid bid; if (!id.IsGuid(out bid)) { continue; } var comment = bworkFlowDelegation.Get(bid); if (comment != null) { bworkFlowDelegation.Delete(bid); RoadFlow.Platform.Log.Add("删除了流程意见", comment.Serialize(), RoadFlow.Platform.Log.Types.流程相关); } } bworkFlowDelegation.RefreshCache(); } } string pager; bool isOneSelf = "1" == Request.QueryString["isoneself"]; if (isOneSelf) { workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, query1, RoadFlow.Platform.UsersBLL.CurrentUserID.ToString(), startTime, endTime); } else { workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, query1, "", startTime, endTime); } ViewBag.Query1 = query1; return(View(workFlowDelegationList)); }
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) + "}"); }
protected void Page_Load(object sender, EventArgs e) { isoneself = "1" == Request.QueryString["isoneself"]; if (isoneself) { this.S_UserID.Disabled = true; this.S_UserID.Value = RoadFlow.Platform.Users.PREFIX + RoadFlow.Platform.Users.CurrentUserID.ToString(); } RoadFlow.Platform.WorkFlowDelegation bworkFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation(); RoadFlow.Platform.Organize borganize = new RoadFlow.Platform.Organize(); RoadFlow.Platform.Users busers = new RoadFlow.Platform.Users(); RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.Platform.WorkFlow(); string startTime = string.Empty; string endTime = string.Empty; string suserid = string.Empty; string Query1 = string.Format("&appid={0}&tabid={1}&isoneself={2}", Request.QueryString["appid"], Request.QueryString["tabid"], Request.QueryString["isoneself"]); if (IsPostBack) { if (!Request.Form["DeleteBut"].IsNullOrEmpty()) { string ids = Request.Form["checkbox_app"]; foreach (string id in ids.Split(',')) { Guid bid; if (!id.IsGuid(out bid)) { continue; } var comment = bworkFlowDelegation.Get(bid); if (comment != null) { bworkFlowDelegation.Delete(bid); RoadFlow.Platform.Log.Add("删除了流程意见", comment.Serialize(), RoadFlow.Platform.Log.Types.流程相关); } } bworkFlowDelegation.RefreshCache(); } startTime = Request.Form["S_StartTime"]; endTime = Request.Form["S_EndTime"]; suserid = Request.Form["S_UserID"]; } else { startTime = Request.QueryString["S_StartTime"]; endTime = Request.QueryString["S_EndTime"]; suserid = Request.QueryString["S_UserID"]; } Query1 += "&S_StartTime=" + startTime + "&S_EndTime=" + endTime + "&S_UserID=" + suserid; string pager; bool isOneSelf = "1" == Request.QueryString["isoneself"]; if (isOneSelf) { workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, Query1, RoadFlow.Platform.Users.CurrentUserID.ToString(), startTime, endTime); } else { workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, Query1, RoadFlow.Platform.Users.RemovePrefix(suserid), startTime, endTime); } this.Pager.Text = pager; }