Exemple #1
0
        public string Query()
        {
            RoadFlow.Platform.WorkFlowDelegation workFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation();
            new RoadFlow.Platform.Organize();
            RoadFlow.Platform.Users    users    = new RoadFlow.Platform.Users();
            RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow();
            string startTime  = base.Request.Form["S_StartTime"];
            string endTime    = base.Request.Form["S_EndTime"];
            string id         = base.Request.Form["S_UserID"];
            string text       = base.Request.Form["sidx"];
            string text2      = base.Request.Form["sord"];
            string text3      = base.Request.Form["typeid"];
            int    pageSize   = Tools.GetPageSize();
            int    pageNumber = Tools.GetPageNumber();
            string order      = (text.IsNullOrEmpty() ? "SenderTime" : text) + " " + (text2.IsNullOrEmpty() ? "asc" : text2);
            long   count;
            IEnumerable <RoadFlow.Data.Model.WorkFlowDelegation> enumerable = (!("1" == base.Request.QueryString["isoneself"])) ? workFlowDelegation.GetPagerData(out count, pageSize, pageNumber, RoadFlow.Platform.Users.RemovePrefix(id), startTime, endTime, order) : workFlowDelegation.GetPagerData(out count, pageSize, pageNumber, MyController.CurrentUserID.ToString(), startTime, endTime, order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlowDelegation item in enumerable)
            {
                string data = "委托中";
                if (item.StartTime > DateTimeNew.Now)
                {
                    data = "未开始";
                }
                else if (item.EndTime < DateTimeNew.Now)
                {
                    data = "已失效";
                }
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]        = item.ID.ToString();
                jsonData2["UserID"]    = users.GetName(item.UserID);
                jsonData2["ToUserID"]  = users.GetName(item.ToUserID);
                jsonData2["FlowID"]    = (item.FlowID.HasValue ? workFlow.GetFlowName(item.FlowID.Value) : "");
                jsonData2["StartTime"] = item.StartTime.ToDateTimeString();
                jsonData2["EndTime"]   = item.EndTime.ToDateTimeString();
                jsonData2["Note"]      = item.Note;
                jsonData2["Status"]    = data;
                jsonData2["Edit"]      = "<a class=\"editlink\" href=\"javascript:edit('" + item.ID.ToString() + "');\">编辑</a>";
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Exemple #2
0
        public string Query()
        {
            new List <RoadFlow.Data.Model.WorkFlow>();
            RoadFlow.Platform.Users    users    = new RoadFlow.Platform.Users();
            RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow();
            string name   = base.Request.Form["flow_name"];
            string str    = base.Request.Form["typeid"];
            string text   = base.Request.Form["sidx"];
            string text2  = base.Request.Form["sord"];
            bool   flag   = "1" == base.Request.Form["openlist"];
            string typeid = "";

            if (str.IsGuid())
            {
                typeid = new RoadFlow.Platform.Dictionary().GetAllChildsIDString(str.ToGuid());
            }
            int    num        = flag ? 10 : RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            string order      = (text.IsNullOrEmpty() ? "CreateDate" : text) + " " + (text2.IsNullOrEmpty() ? "asc" : text2);
            long   count;
            List <RoadFlow.Data.Model.WorkFlow> pagerData = workFlow.GetPagerData(out count, num, pageNumber, RoadFlow.Platform.Users.CurrentUserID.ToString(), typeid, name, order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlow item in pagerData)
            {
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]           = item.ID.ToString();
                jsonData2["Name"]         = item.Name;
                jsonData2["CreateDate"]   = item.CreateDate.ToDateTimeString();
                jsonData2["CreateUserID"] = users.GetName(item.CreateUserID);
                jsonData2["Status"]       = workFlow.GetStatusTitle(item.Status);
                if (flag)
                {
                    jsonData2["Edit"] = "<a href=\"javascript:void(0);\" onclick=\"openflow('" + item.ID + "');return false;\"><img src=\"" + base.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"] = "<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"openflow('" + item.ID + "','" + item.Name + "');return false;\"><span style=\"vertical-align:middle;\">编辑</span></a><a class=\"deletelink\" href=\"javascript:void(0);\" style=\"margin-left:5px\" onclick=\"delflow('" + item.ID + "'); return false;\"><span style=\"vertical-align:middle;\">删除</span></a><a href=\"javascript:void(0);\" style=\"margin-left:5px\" onclick=\"ExportFlow('" + item.ID + "'); return false;\"><span style=\"vertical-align:middle; background:url(../Images/ico/arrow_medium_right.png) no-repeat;padding-left:18px;\">导出</span></a>";
                }
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + num + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }