Exemplo n.º 1
0
 public ActionResult Import(FormCollection collection)
 {
     if (collection != null)
     {
         HttpPostedFileBase httpPostedFileBase = base.Request.Files["FileUpload1"];
         if (httpPostedFileBase == null || httpPostedFileBase.FileName.IsNullOrEmpty())
         {
             base.ViewBag.script = "alert('请选择要导入的文件!');";
             return(View());
         }
         string text = RoadFlow.Utility.Config.FilePath + "WorkFlowImportFiles\\" + Guid.NewGuid().ToString("N");
         if (!Directory.Exists(text))
         {
             Directory.CreateDirectory(text);
         }
         string text2 = text + "\\" + httpPostedFileBase.FileName;
         httpPostedFileBase.SaveAs(text2);
         string text3 = new RoadFlow.Platform.WorkFlow().Import(text2, 1);
         if ("1" == text3)
         {
             base.ViewBag.script = "alert('导入成功!');new RoadUI.Window().reloadOpener();";
         }
         else
         {
             base.ViewBag.script = "alert('" + text3 + "');new RoadUI.Window().reloadOpener();";
         }
     }
     return(View());
 }
        public ActionResult InstanceList()
        {
            new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow();
            string text = base.Request.QueryString["typeid"];
            Dictionary <Guid, string> instanceManageFlowIDList = workFlow.GetInstanceManageFlowIDList(RoadFlow.Platform.Users.CurrentUserID, text);
            string options             = workFlow.GetOptions(instanceManageFlowIDList, text);
            string text2               = string.Format("&appid={0}&tabid={1}&typeid={2}", base.Request.QueryString["appid"], base.Request.QueryString["tabid"], text);
            List <SelectListItem> list = new List <SelectListItem>();

            list.Add(new SelectListItem
            {
                Text  = "==全部==",
                Value = "0"
            });
            list.Add(new SelectListItem
            {
                Text  = "未完成",
                Value = "1"
            });
            list.Add(new SelectListItem
            {
                Text  = "已完成",
                Value = "2"
            });
            base.ViewBag.Query       = text2;
            base.ViewBag.StatusItems = list;
            base.ViewBag.FlowOptions = options;
            return(View());
        }
Exemplo n.º 3
0
        public string GetJSON()
        {
            string msg;

            if (!WebMvc.Common.Tools.CheckLogin(out msg) && !RoadFlow.Platform.WeiXin.Organize.CheckLogin())
            {
                return("{}");
            }
            string str = base.Request.QueryString["flowid"];
            string b   = base.Request.QueryString["type"];

            if (!str.IsGuid())
            {
                return("{}");
            }
            RoadFlow.Data.Model.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow().Get(str.ToGuid());
            if (workFlow == null)
            {
                return("{}");
            }
            if (!("0" == b))
            {
                return(workFlow.DesignJSON);
            }
            return(workFlow.RunJSON);
        }
        public ActionResult WaitList()
        {
            RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow();
            base.ViewBag.flowOptions = workFlow.GetOptions();
            string text = string.Format("&appid={0}&tabid={1}", base.Request.QueryString["appid"], base.Request.QueryString["tabid"]);

            base.ViewBag.query = text;
            return(View());
        }
        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 str        = 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 text       = base.Request.Form["sidx"];
            string text2      = base.Request.Form["sord"];
            string text3      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            string order      = (text.IsNullOrEmpty() ? "CompletedTime1" : text) + " " + (text2.IsNullOrEmpty() ? "asc" : text2);
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> tasks = workFlowTask.GetTasks(MyController.CurrentUserID, out count, pageSize, pageNumber, str.Trim1(), 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"]   = item.ReceiveTime.ToDateTimeString();
                jsonData2["CompletedTime"] = (item.CompletedTime1.HasValue ? item.CompletedTime1.Value.ToDateTimeString() : "");
                jsonData2["SenderName"]    = item.SenderName;
                jsonData2["StepName"]      = item.StepName;
                jsonData2["Title"]         = "<a href=\"javascript:void(0);\" onclick=\"openTask('/WorkFlowRun/Index?" + string.Format("flowid={0}&stepid={1}&instanceid={2}&taskid={3}&groupid={4}&appid={5}&display=1", item.FlowID, item.StepID, item.InstanceID, item.ID, item.GroupID, text3) + "','" + item.Title.RemoveHTML().UrlEncode() + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + item.Title.HtmlEncode() + "</a>";
                jsonData2["Opation"]       = stringBuilder.ToString();
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Exemplo n.º 6
0
 public ActionResult StartFlow(FormCollection collection)
 {
     string s_FlowName = base.Request.QueryString["FlowName"];
     if (collection != null)
     {
         s_FlowName = base.Request.Form["FlowName"];
     }
     List<WorkFlowStart> list = new RoadFlow.Platform.WorkFlow().GetUserStartFlows(RoadFlow.Platform.Users.CurrentUserID);
     if (!s_FlowName.IsNullOrEmpty())
     {
         list = list.FindAll((WorkFlowStart p) => p.Name.Contains(s_FlowName.Trim1(), StringComparison.CurrentCultureIgnoreCase));
     }
     base.ViewBag.FlowName = s_FlowName;
     return View(list);
 }
Exemplo n.º 7
0
        public void Export()
        {
            string msg;

            if (WebMvc.Common.Tools.CheckLogin(out msg))
            {
                string str = new RoadFlow.Platform.WorkFlow().Export(base.Request.QueryString["flowid"].ToGuid(), 1);
                if (!str.IsNullOrEmpty())
                {
                    base.Response.Redirect("../Files/Show?id=" + str.DesEncrypt() + "&appid=" + base.Request.QueryString["appid"] + "&tabid=" + base.Request.QueryString["tabid"]);
                }
                else
                {
                    base.Response.Write("导出失败");
                    base.Response.End();
                }
            }
        }
Exemplo n.º 8
0
        public ActionResult Index(FormCollection coll)
        {
            RoadFlow.Platform.WeiXin.Organize.CheckLogin();
            new RoadFlow.Platform.Users();
            string s_searchkey = base.Request.QueryString["searchkey"];

            if (coll != null)
            {
                s_searchkey = base.Request.Form["searchkey"];
            }
            List <WorkFlowStart> list = new RoadFlow.Platform.WorkFlow().GetUserStartFlows(RoadFlow.Platform.WeiXin.Organize.CurrentUserID);

            if (!s_searchkey.IsNullOrEmpty())
            {
                list = list.FindAll((WorkFlowStart p) => p.Name.Contains(s_searchkey.Trim1(), StringComparison.CurrentCultureIgnoreCase));
            }
            return(View(list));
        }
Exemplo n.º 9
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() + "}");
        }
Exemplo n.º 10
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() + "}");
        }
Exemplo n.º 11
0
        public ActionResult DetailSubFlow()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            string text = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&title={4}&flowid={5}&sender={6}&date1={7}&date2={8}&iframeid={9}&openerid={10}&taskid={11}", base.Request.QueryString["flowid"], base.Request.QueryString["groupid"], base.Request.QueryString["appid"], base.Request.QueryString["tabid"], base.Request.QueryString["title"].UrlEncode(), base.Request.QueryString["flowid"], base.Request.QueryString["sender"], base.Request.QueryString["date1"], base.Request.QueryString["date2"], base.Request.QueryString["iframeid"], base.Request.QueryString["openerid"], base.Request.QueryString["taskid"]);

            base.ViewBag.flowid       = base.Request.QueryString["flowid"];
            base.ViewBag.groupid      = base.Request.QueryString["groupid"];
            base.ViewBag.displayModel = base.Request.QueryString["displaymodel"];
            base.ViewBag.wfInstall    = null;
            base.ViewBag.query        = text;
            string str   = base.Request.QueryString["taskid"];
            string text2 = base.Request.QueryString["displaymodel"];

            if (!str.IsGuid())
            {
                return(View(new List <RoadFlow.Data.Model.WorkFlowTask>()));
            }
            RoadFlow.Data.Model.WorkFlowTask workFlowTask2 = workFlowTask.Get(str.ToGuid());
            if (workFlowTask2 == null || workFlowTask2.SubFlowGroupID.IsNullOrEmpty())
            {
                return(View(new List <RoadFlow.Data.Model.WorkFlowTask>()));
            }
            List <RoadFlow.Data.Model.WorkFlowTask> list = new List <RoadFlow.Data.Model.WorkFlowTask>();

            string[] array = workFlowTask2.SubFlowGroupID.Split(',');
            foreach (string str2 in array)
            {
                list.AddRange(workFlowTask.GetTaskList(Guid.Empty, str2.ToGuid()));
            }
            if (list.Count == 0)
            {
                base.Response.Write("未找到任务");
                base.Response.End();
                return(null);
            }
            WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(list.FirstOrDefault().FlowID);

            base.ViewBag.wfInstall = workFlowRunModel;
            base.ViewBag.flowid    = list.FirstOrDefault().FlowID.ToString();
            return(View(list));
        }
Exemplo n.º 12
0
        public ActionResult Detail()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            string            text             = base.Request.QueryString["flowid1"] ?? base.Request.QueryString["flowid"];
            string            text2            = base.Request.QueryString["groupid"];
            string            text3            = base.Request.QueryString["displaymodel"];
            WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(text);
            IOrderedEnumerable <RoadFlow.Data.Model.WorkFlowTask> orderedEnumerable = from p in workFlowTask.GetTaskList(text.ToGuid(), text2.ToGuid())
                                                                                      where p.Status != -1
                                                                                      orderby p.Sort, p.StepSort
            select p;
            string text4 = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&iframeid={4}&openerid={5}", text, text2, base.Request.QueryString["appid"], base.Request.QueryString["tabid"], base.Request.QueryString["iframeid"], base.Request.QueryString["openerid"]);
            string text5 = string.Format("&groupid={0}&appid={1}&tabid={2}&ismobile={3}", text2, base.Request.QueryString["appid"], base.Request.QueryString["tabid"], base.Request.QueryString["ismobile"]);

            base.ViewBag.flowid       = text;
            base.ViewBag.groupid      = text2;
            base.ViewBag.displayModel = text3;
            base.ViewBag.wfInstall    = workFlowRunModel;
            base.ViewBag.query        = text4;
            base.ViewBag.query1       = text5;
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlowTask item in orderedEnumerable)
            {
                JsonData jsonData2 = new JsonData();
                jsonData2["StepName"]       = item.StepName;
                jsonData2["SenderName"]     = item.SenderName;
                jsonData2["SenderTime"]     = item.SenderTime.ToDateTimeStringS();
                jsonData2["ReceiveName"]    = item.ReceiveName;
                jsonData2["CompletedTime1"] = (item.CompletedTime1.HasValue ? item.CompletedTime1.Value.ToDateTimeStringS() : "");
                jsonData2["StatusTitle"]    = workFlowTask.GetStatusTitle(item.Status);
                jsonData2["Comment"]        = item.Comment;
                jsonData2["Note"]           = item.Note;
                jsonData.Add(jsonData2);
            }
            base.ViewBag.list = (jsonData.IsArray ? jsonData.ToJson() : "{}");
            return(View(orderedEnumerable));
        }
Exemplo n.º 13
0
        public ActionResult InstanceManage()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            string            text             = base.Request.QueryString["flowid1"];
            string            str              = base.Request.QueryString["groupid"];
            WorkFlowInstalled workFlowRunModel = workFlow.GetWorkFlowRunModel(text);
            IOrderedEnumerable <RoadFlow.Data.Model.WorkFlowTask> orderedEnumerable = from p in workFlowTask.GetTaskList(text.ToGuid(), str.ToGuid())
                                                                                      orderby p.Sort
                                                                                      select p;
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.WorkFlowTask item in orderedEnumerable)
            {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/permission.gif") + ") no-repeat left center; padding-left:18px;\" href=\"javascript:void(0);\" onclick=\"cngStatus('" + item.ID + "');\">状态</a>");
                if (item.Status.In(0, 1))
                {
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/arrow_medium_lower_left.png") + ") no-repeat left center; padding-left:16px;\" href=\"javascript:void(0);\" onclick=\"designate('" + item.ID + "');\">指派</a>");
                    stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/arrow_medium_lower_right.png") + ") no-repeat left center; padding-left:16px;\" href=\"javascript:void(0);\" onclick=\"goTo('" + item.ID + "');\">跳转</a>");
                }
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]             = item.ID.ToString();
                jsonData2["StepID"]         = workFlow.GetStepName(item.StepID, workFlowRunModel);
                jsonData2["SenderName"]     = item.SenderName;
                jsonData2["ReceiveTime"]    = item.ReceiveTime.ToDateTimeStringS();
                jsonData2["ReceiveName"]    = item.ReceiveName;
                jsonData2["CompletedTime1"] = (item.CompletedTime1.HasValue ? item.CompletedTime1.Value.ToDateTimeStringS() : "");
                jsonData2["Status"]         = workFlowTask.GetStatusTitle(item.Status);
                jsonData2["Comment"]        = item.Comment;
                jsonData2["Opation"]        = stringBuilder.ToString();
                jsonData.Add(jsonData2);
            }
            base.ViewBag.list = jsonData.ToJson();
            return(View());
        }
Exemplo n.º 14
0
        public string QueryInstanceList()
        {
            RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
            RoadFlow.Platform.WorkFlow     workFlow     = new RoadFlow.Platform.WorkFlow();
            string str    = base.Request.Form["Title"];
            string flowid = base.Request.Form["FlowID"];
            string text   = base.Request.Form["SenderID"];
            string date   = base.Request.Form["Date1"];
            string date2  = base.Request.Form["Date2"];
            string str2   = base.Request.Form["Status"];
            string text2  = base.Request.Form["sidx"];
            string text3  = base.Request.Form["sord"];
            string typeID = base.Request.Form["typeid"];
            string text4  = base.Request.Form["appid"];
            Dictionary <Guid, string> instanceManageFlowIDList = workFlow.GetInstanceManageFlowIDList(RoadFlow.Platform.Users.CurrentUserID, typeID);
            List <Guid> list = new List <Guid>();

            foreach (KeyValuePair <Guid, string> item in from p in instanceManageFlowIDList
                     orderby p.Value
                     select p)
            {
                list.Add(item.Key);
            }
            Guid[]    flowID     = list.ToArray();
            int       pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int       pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            string    order      = (text2.IsNullOrEmpty() ? "SenderTime" : text2) + " " + (text3.IsNullOrEmpty() ? "asc" : text3);
            long      count;
            DataTable instances = workFlowTask.GetInstances1(flowID, new Guid[0], text.IsNullOrEmpty() ? new Guid[0] : new Guid[1]
            {
                text.Replace("u_", "").ToGuid()
            }, out count, pageSize, pageNumber, str.Trim1(), flowid, date, date2, str2.ToInt(), order);
            JsonData jsonData = new JsonData();

            foreach (DataRow row in instances.Rows)
            {
                RoadFlow.Data.Model.WorkFlowTask lastTask = workFlowTask.GetLastTask(row["FlowID"].ToString().ToGuid(), row["GroupID"].ToString().ToGuid());
                if (lastTask != null)
                {
                    string        flowName;
                    string        stepName      = workFlow.GetStepName(lastTask.StepID, lastTask.FlowID, out flowName);
                    string        text5         = string.Format("flowid={0}&stepid={1}&instanceid={2}&taskid={3}&groupid={4}&appid={5}&display=1", lastTask.FlowID, lastTask.StepID, lastTask.InstanceID, lastTask.ID, lastTask.GroupID, text4);
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.Append("<a style=\"margin-right:5px; background:url(" + base.Url.Content("~/Images/ico/mouse.png") + ") no-repeat left center; padding-left:18px;\" href=\"javascript:void(0);\" onclick=\"manage('" + lastTask.FlowID.ToString() + "','" + lastTask.GroupID.ToString() + "');\">管理</a>");
                    if (lastTask.Status.In(-1, 0, 1))
                    {
                        stringBuilder.Append("<a style=\"background:url(" + base.Url.Content("~/Images/ico/trash.gif") + ") no-repeat left center; padding-left:18px;\" href=\"javascript:void(0);\" onclick=\"delete1('" + lastTask.FlowID.ToString() + "','" + lastTask.GroupID.ToString() + "');\">删除</a>");
                    }
                    JsonData jsonData2 = new JsonData();
                    jsonData2["id"]          = lastTask.ID.ToString();
                    jsonData2["Title"]       = "<a href=\"javascript:void(0);\" onclick=\"openTask('/WorkFlowRun/Index?" + text5 + "','" + lastTask.Title.RemoveHTML().UrlEncode() + "','" + lastTask.ID + "');return false;\" class=\"blue\">" + lastTask.Title.HtmlEncode() + "</a>";
                    jsonData2["FlowName"]    = flowName;
                    jsonData2["StepName"]    = stepName;
                    jsonData2["ReceiveName"] = lastTask.ReceiveName;
                    jsonData2["ReceiveTime"] = lastTask.ReceiveTime.ToDateTimeStringS();
                    jsonData2["StatusTitle"] = lastTask.Status;
                    jsonData2["Opation"]     = stringBuilder.ToString();
                    jsonData.Add(jsonData2);
                }
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Exemplo n.º 15
0
 public ActionResult FlowCopyFor(FormCollection collection)
 {
     RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow();
     RoadFlow.Platform.WorkFlowTask workFlowTask = new RoadFlow.Platform.WorkFlowTask();
     WorkFlowInstalled workFlowInstalled = null;
     RoadFlow.Data.Model.WorkFlowTask workFlowTask2 = null;
     string flowID = base.Request.QueryString["flowid"];
     string stepid = base.Request.QueryString["stepid"];
     string text = base.Request.QueryString["groupid"];
     string text2 = base.Request.QueryString["instanceid"];
     workFlowInstalled = workFlow.GetWorkFlowRunModel(flowID);
     if (workFlowInstalled == null)
     {
         base.Response.Write("未找到流程运行实体");
         base.Response.End();
         return null;
     }
     if ((from p in workFlowInstalled.Steps
     where p.ID == stepid.ToGuid()
     select p).Count() == 0)
     {
         base.Response.Write("未找到当前步骤");
         base.Response.End();
         return null;
     }
     workFlowTask2 = workFlowTask.Get(base.Request.QueryString["taskid"].ToGuid());
     if (workFlowTask2 == null)
     {
         base.Response.Write("当前任务为空,请先保存再抄送!");
         base.Response.End();
         return null;
     }
     if (collection != null)
     {
         List<RoadFlow.Data.Model.WorkFlowTask> taskList = workFlowTask.GetTaskList(workFlowTask2.ID);
         List<RoadFlow.Data.Model.Users> allUsers = new RoadFlow.Platform.Organize().GetAllUsers(base.Request.Form["user"] ?? "");
         StringBuilder stringBuilder = new StringBuilder();
         foreach (RoadFlow.Data.Model.Users item in allUsers)
         {
             if (taskList.Find((RoadFlow.Data.Model.WorkFlowTask p) => p.ReceiveID == item.ID) == null)
             {
                 Step step = (from p in workFlowInstalled.Steps
                 where p.ID == base.Request.QueryString["stepid"].ToGuid()
                 select p).First();
                 RoadFlow.Data.Model.WorkFlowTask workFlowTask3 = new RoadFlow.Data.Model.WorkFlowTask();
                 if (step.WorkTime > decimal.Zero)
                 {
                     workFlowTask3.CompletedTime = DateTimeNew.Now.AddHours((double)step.WorkTime);
                 }
                 workFlowTask3.FlowID = workFlowTask2.FlowID;
                 workFlowTask3.GroupID = workFlowTask2.GroupID;
                 workFlowTask3.ID = Guid.NewGuid();
                 workFlowTask3.Type = 5;
                 workFlowTask3.InstanceID = workFlowTask2.InstanceID;
                 workFlowTask3.Note = "抄送任务";
                 workFlowTask3.PrevID = workFlowTask2.PrevID;
                 workFlowTask3.PrevStepID = workFlowTask2.PrevStepID;
                 workFlowTask3.ReceiveID = item.ID;
                 workFlowTask3.ReceiveName = item.Name;
                 workFlowTask3.ReceiveTime = DateTimeNew.Now;
                 workFlowTask3.SenderID = workFlowTask2.ReceiveID;
                 workFlowTask3.SenderName = workFlowTask2.ReceiveName;
                 workFlowTask3.SenderTime = workFlowTask3.ReceiveTime;
                 workFlowTask3.Status = 0;
                 workFlowTask3.StepID = workFlowTask2.StepID;
                 workFlowTask3.StepName = workFlowTask2.StepName;
                 workFlowTask3.Sort = workFlowTask2.Sort;
                 workFlowTask3.Title = workFlowTask2.Title;
                 workFlowTask.Add(workFlowTask3);
                 stringBuilder.Append(workFlowTask3.ReceiveName);
                 stringBuilder.Append(",");
             }
         }
         base.ViewBag.script = "alert('成功抄送给:" + stringBuilder.ToString().TrimEnd(',') + "');new RoadUI.Window().close();";
     }
     return View();
 }
Exemplo n.º 16
0
        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 str        = 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 text       = base.Request.Form["sidx"];
            string text2      = base.Request.Form["sord"];
            string text3      = "";
            int    pageSize   = RoadFlow.Utility.Tools.GetPageSize();
            int    pageNumber = RoadFlow.Utility.Tools.GetPageNumber();
            long   count;
            List <RoadFlow.Data.Model.WorkFlowTask> obj = workFlowTask.GetTasks(order: (text.IsNullOrEmpty() ? "ReceiveTime" : text) + " " + (text2.IsNullOrEmpty() ? "asc" : text2), userID: MyController.CurrentUserID, count: out count, size: pageSize, number: pageNumber, title: str.Trim1(), 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"] = item.ReceiveTime.ToDateTimeString();
                jsonData2["SenderName"]  = item.SenderName;
                if (item.CompletedTime.HasValue)
                {
                    if (item.CompletedTime.Value < DateTimeNew.Now)
                    {
                        jsonData2["StatusTitle"] = "<i title=\"已过期\" class=\"fa fa-bell\" style=\"color:red;font-weight:bold;\"><span title=\"要求完成时间:" + item.CompletedTime.Value.ToDateTimeString() + "\">已过期</span></i>";
                    }
                    else if ((item.CompletedTime.Value - DateTimeNew.Now).Days <= 3)
                    {
                        jsonData2["StatusTitle"] = "<i title=\"即将过期\" class=\"fa fa-bell\" style=\"color:#fd8a02;font-weight:bold;\"><span title=\"要求完成时间:" + item.CompletedTime.Value.ToDateTimeString() + "\">即将到期</span></i>";
                    }
                    else
                    {
                        jsonData2["StatusTitle"] = "<i title=\"正常\" class=\"fa fa-bell\" style=\"color:#666;font-weight:bold;\"></i><span title=\"要求完成时间:" + item.CompletedTime.Value.ToDateTimeString() + "\">正常</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?" + string.Format("flowid={0}&stepid={1}&instanceid={2}&taskid={3}&groupid={4}&appid={5}", item.FlowID, item.StepID, item.InstanceID, item.ID, item.GroupID, text3) + "','" + item.Title.RemoveHTML().UrlEncode() + "','" + item.ID + "'," + num + "," + num2 + "," + num3 + ");return false;\">" + item.Title.HtmlEncode() + "</a>";
                string text4 = "<a href=\"javascript:void(0);\" class=\"editlink\" onclick=\"openTask('/WorkFlowRun/Index?" + string.Format("flowid={0}&stepid={1}&instanceid={2}&taskid={3}&groupid={4}&appid={5}", item.FlowID, item.StepID, item.InstanceID, item.ID, item.GroupID, text3) + "','" + item.Title.RemoveHTML().UrlEncode() + "','" + 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)
                {
                    text4 = text4 + "&nbsp;&nbsp;<a class=\"deletelink\" href=\"javascript:void(0);\" onclick=\"delTask('" + item.FlowID + "','" + item.GroupID + "','" + item.ID + "');return false;\">作废</a>";
                }
                jsonData2["Opation"] = text4;
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
 public ActionResult Index()
 {
     RoadFlow.Platform.WorkFlow workFlow = new RoadFlow.Platform.WorkFlow();
     base.ViewBag.flowOptions = workFlow.GetOptions();
     return(View());
 }