Exemple #1
0
        protected void Page_Load(object sender1, EventArgs e)
        {
            string title  = "";
            string flowid = "";
            string sender = "";
            string date1  = "";
            string date2  = "";

            if (IsPostBack)
            {
                title  = Request.Form["Title1"];
                flowid = Request.Form["FlowID"];
                sender = Request.Form["SenderID"];
                date1  = Request.Form["Date1"];
                date2  = Request.Form["Date2"];
            }
            else
            {
                title  = Request.QueryString["title"];
                flowid = Request.QueryString["flowid"];
                sender = Request.QueryString["sender"];
                date1  = Request.QueryString["date1"];
                date2  = Request.QueryString["date2"];
            }

            query = string.Format("&appid={0}&tabid={1}&title={2}&flowid={3}&sender={4}&date1={5}&date2={6}",
                                  Request.QueryString["appid"], Request.QueryString["tabid"], title.UrlEncode(), flowid, sender, date1, date2);
            string pager;

            taskList = bworkFlowTask.GetTasks(RoadFlow.Platform.Users.CurrentUserID,
                                              out pager, query, title, flowid, sender, date1, date2);

            this.flowOptions.Text = bworkFlow.GetOptions(flowid);
            this.Pager.Text       = pager;
        }
        public string QueryCompletedList()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            RoadFlow.Platform.AppLibrary   appLibrary   = new RoadFlow.Platform.AppLibrary();
            string text       = base.Request.Form["title"];
            string flowid     = base.Request.Form["flowid"];
            string sender     = base.Request.Form["sender"];
            string date       = base.Request.Form["date1"];
            string date2      = base.Request.Form["date2"];
            string text2      = base.Request.Form["sidx"];
            string text3      = base.Request.Form["sord"];
            string text4      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            string order      = (MyExtensions.IsNullOrEmpty(text2) ? "CompletedTime1" : text2) + " " + (MyExtensions.IsNullOrEmpty(text3) ? "asc" : text3);
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> tasks = workFlowTask.GetTasks(MyController.CurrentUserID, out count, pageSize, pageNumber, MyExtensions.Trim1(text), flowid, sender, date, date2, 1, order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlowTask item in tasks)
            {
                bool isHasten = false;
                RoadFlow.Data.Model.AppLibrary byCode = appLibrary.GetByCode(item.FlowID.ToString());
                int num  = 0;
                int num2 = 1000;
                int num3 = 500;
                if (byCode != null)
                {
                    num  = byCode.OpenMode;
                    num2 = (byCode.Width.HasValue ? byCode.Width.Value : 1000);
                    num3 = (byCode.Height.HasValue ? byCode.Height.Value : 500);
                }
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("<a class=\"viewlink\" href=\"javascript:void(0);\" onclick=\"detail('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">查看</a>");
                if (item.Status == 2 && workFlowTask.HasWithdraw(item.ID, out isHasten))
                {
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/back.gif") + ") no-repeat left center; padding-left:18px;margin-left:5px;\" href=\"javascript:void(0);\" onclick=\"withdraw('" + item.ID + "');\">收回</a>");
                }
                if (isHasten)
                {
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/comment_reply.png") + ") no-repeat left center; padding-left:18px;margin-left:5px;\" href=\"javascript:void(0);\" onclick=\"hasten('" + item.ID + "');\">催办</a>");
                }
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]            = item.ID.ToString();
                jsonData2["FlowName"]      = workFlow.GetFlowName(item.FlowID);
                jsonData2["Note"]          = item.Note;
                jsonData2["ReceiveTime"]   = MyExtensions.ToDateTimeString(item.ReceiveTime);
                jsonData2["CompletedTime"] = (item.CompletedTime1.HasValue ? MyExtensions.ToDateTimeString(item.CompletedTime1.Value) : "");
                jsonData2["SenderName"]    = item.SenderName;
                jsonData2["StepName"]      = item.StepName;
                jsonData2["Title"]         = "<a href=\"javascript:void(0);\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}&display=1" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + MyExtensions.HtmlEncode(item.Title) + "</a>";
                jsonData2["Opation"]       = stringBuilder.ToString();
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Exemple #3
0
        public ActionResult CompletedList(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowTask bworkFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     bworkFlow     = new RoadFlow.Platform.WorkFlow();


            string title  = "";
            string flowid = "";
            string sender = "";
            string date1  = "";
            string date2  = "";

            if (collection != null)
            {
                title  = Request.Form["Title"];
                flowid = Request.Form["FlowID"];
                sender = Request.Form["SenderID"];
                date1  = Request.Form["Date1"];
                date2  = Request.Form["Date2"];
            }
            else
            {
                title  = Request.QueryString["title"];
                flowid = Request.QueryString["flowid"];
                sender = Request.QueryString["sender"];
                date1  = Request.QueryString["date1"];
                date2  = Request.QueryString["date2"];
            }
            ViewBag.title  = title;
            ViewBag.flowid = flowid;
            ViewBag.sender = sender;
            ViewBag.date1  = date1;
            ViewBag.date2  = date2;

            string query2 = string.Format("&appid={0}&tabid={1}&title={2}&flowid={3}&sender={4}&date1={5}&date2={6}",
                                          Request.QueryString["appid"], Request.QueryString["tabid"], title.UrlEncode(), flowid, sender, date1, date2
                                          );

            string query = string.Format("{0}&pagesize={1}&pagenumber={2}",
                                         query2,
                                         Request.QueryString["pagesize"], Request.QueryString["pagenumber"]
                                         );

            string pager;

            var taskList = bworkFlowTask.GetTasks(RoadFlow.Platform.Users.CurrentUserID,
                                                  out pager, query2, title, flowid, sender, date1, date2, 1);

            ViewBag.pager       = pager;
            ViewBag.flowOptions = bworkFlow.GetOptions(flowid);
            ViewBag.query       = query;
            return(View(taskList));
        }
Exemple #4
0
        protected void Page_Load(object sender1, EventArgs e)
        {
            string title  = "";
            string flowid = "";
            string sender = "";
            string date1  = "";
            string date2  = "";

            if (IsPostBack)
            {
                title  = Request.Form["Title1"];
                flowid = Request.Form["FlowID"];
                sender = Request.Form["SenderID"];
                date1  = Request.Form["Date1"];
                date2  = Request.Form["Date2"];
            }
            else
            {
                title  = Request.QueryString["title"];
                flowid = Request.QueryString["flowid"];
                sender = Request.QueryString["sender"];
                date1  = Request.QueryString["date1"];
                date2  = Request.QueryString["date2"];
            }

            query = string.Format("&appid={0}&tabid={1}&title={2}&flowid={3}&sender={4}&date1={5}&date2={6}",
                                  Request.QueryString["appid"], Request.QueryString["tabid"], title.UrlEncode(), flowid, sender, date1, date2);
            string pager;

            taskList = bworkFlowTask.GetTasks(RoadFlow.Platform.Users.CurrentUserID,
                                              out pager, query, title, flowid, sender, date1, date2);

            //var flows = new RoadFlow.Platform.AppLibrary().GetAll();
            //System.Text.StringBuilder sb = new System.Text.StringBuilder("<table>");
            //sb.Append("<thead class='mygrid1'>");
            //sb.Append("<tr>");
            //sb.Append("<th width='33%'>应用名称</th><th width='33%'>地址</th><th width='33%'>类型</th>");
            //sb.Append("</tr>");
            //sb.Append("</thead><tbody>");

            //foreach (var flow in flows)
            //{
            //    sb.Append("<tr>");
            //    sb.Append("<td value='" + flow.ID + "' " + (("," + flowid + ",").Contains(flow.ID.ToString()) ? "isselected='1'" : "") + ">" + flow.Title + "</td>");
            //    sb.Append("<td>" + flow.Note + "</td>");
            //    sb.Append("<td>" + flow.Height + "</td>");
            //    sb.Append("</tr>");
            //}
            //sb.Append("</tbody></table>");

            this.flowOptions.Text = bworkFlow.GetOptions(flowid);
            this.Pager.Text       = pager;
        }
Exemple #5
0
        ///
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="key">表字段</param>
        /// <param name="where"></param>
        /// <returns></returns>
        public static Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object> GetAllTaskByUserId(Guid userID, string key, Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object> where)
        {
            RoadFlow.Platform.WorkFlowTask taskDb = new RoadFlow.Platform.WorkFlowTask();
            string p = string.Empty;
            List <RoadFlow.Data.Model.WorkFlowTask> list = taskDb.GetTasks(userID,
                                                                           out p, "", "", "", "", "", "", 1);
            List <string> listStr = new List <string>();

            foreach (var item in list)
            {
                listStr.Add(item.InstanceID);
            }
            if (listStr.Count > 0 && RoadFlow.Platform.UsersBLL.CurrentUserName != "系统管理员")
            {
                where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>(key, RoadFlow.Data.Model.SQLFilterType.IN), listStr);
            }
            else if (RoadFlow.Platform.UsersBLL.CurrentUserName != "系统管理员")
            {
                where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>(key, RoadFlow.Data.Model.SQLFilterType.EQUAL), "00000000-0000-0000-0000-000000000000");
            }
            return(where);
        }
Exemple #6
0
 protected void InitData()
 {
     TasksList = BWF.GetTasks(UserID, out count, 15, 1, title: SearchTitle, type: 1);
     this.searchkey.Attributes.Add("placeholder", "您共有" + count.ToString() + "条已办事项");
 }
        public string QueryWaitList()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            RoadFlow.Platform.AppLibrary   appLibrary   = new RoadFlow.Platform.AppLibrary();
            string text       = base.Request.Form["title"];
            string flowid     = base.Request.Form["flowid"];
            string sender     = base.Request.Form["sender"];
            string date       = base.Request.Form["date1"];
            string date2      = base.Request.Form["date2"];
            string text2      = base.Request.Form["sidx"];
            string text3      = base.Request.Form["sord"];
            string text4      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> obj = workFlowTask.GetTasks(order: (MyExtensions.IsNullOrEmpty(text2) ? "ReceiveTime" : text2) + " " + (MyExtensions.IsNullOrEmpty(text3) ? "asc" : text3), userID: MyController.CurrentUserID, count: out count, size: pageSize, number: pageNumber, title: MyExtensions.Trim1(text), flowid: flowid, sender: sender, date1: date, date2: date2);
            JsonData jsonData      = new JsonData();
            Guid     currentUserID = MyController.CurrentUserID;

            foreach (RoadFlow.Data.Model.WorkFlowTask item in obj)
            {
                RoadFlow.Data.Model.AppLibrary byCode = appLibrary.GetByCode(item.FlowID.ToString());
                int num  = 0;
                int num2 = 1000;
                int num3 = 500;
                if (byCode != null)
                {
                    num  = byCode.OpenMode;
                    num2 = (byCode.Width.HasValue ? byCode.Width.Value : 1000);
                    num3 = (byCode.Height.HasValue ? byCode.Height.Value : 500);
                }
                WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(item.FlowID);
                JsonData          jsonData2        = new JsonData();
                jsonData2["id"]          = item.ID.ToString();
                jsonData2["FlowName"]    = workFlow.GetFlowName(item.FlowID);
                jsonData2["StepName"]    = item.StepName;
                jsonData2["Note"]        = item.Note;
                jsonData2["ReceiveTime"] = MyExtensions.ToDateTimeString(item.ReceiveTime);
                jsonData2["SenderName"]  = item.SenderName;
                if (item.CompletedTime.HasValue)
                {
                    if (item.CompletedTime.Value < DateTimeNew.get_Now())
                    {
                        jsonData2["StatusTitle"] = "<i title=\"已过期\" class=\"fa fa-bell\" style=\"color:red;font-weight:bold;\"><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">已过期</span></i>";
                    }
                    else if ((item.CompletedTime.Value - DateTimeNew.get_Now()).Days <= 3)
                    {
                        jsonData2["StatusTitle"] = "<i title=\"即将过期\" class=\"fa fa-bell\" style=\"color:#fd8a02;font-weight:bold;\"><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">即将到期</span></i>";
                    }
                    else
                    {
                        jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:" + MyExtensions.ToDateTimeString(item.CompletedTime.Value) + "\">正常</span></i>";
                    }
                }
                else
                {
                    jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:无时间要求\">正常</span></i>";
                }
                jsonData2["Title"] = "<a href=\"javascript:void(0);\" class=\"blue\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + MyExtensions.HtmlEncode(item.Title) + "</a>";
                string text5 = "<a href=\"javascript:void(0);\" class=\"editlink\" onclick=\"openTask('/WorkFlowRun/Index?" + $"flowid={item.FlowID}&stepid={item.StepID}&instanceid={item.InstanceID}&taskid={item.ID}&groupid={item.GroupID}&appid={text4}" + "','" + MyExtensions.UrlEncode(MyExtensions.RemoveHTML(item.Title)) + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">处理</a>&nbsp;&nbsp;<a class=\"viewlink\" href=\"javascript:void(0);\" onclick=\"detail('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">查看</a>";
                if (workFlowRunModel != null && workFlowRunModel.FirstStepID == item.StepID && item.SenderID == currentUserID)
                {
                    text5 = text5 + "&nbsp;&nbsp;<a class=\"deletelink\" href=\"javascript:void(0);\" onclick=\"delTask('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">作废</a>";
                }
                jsonData2["Opation"] = text5;
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }