public string GetSubTableData()
        {
            string secondtable              = Request["secondtable"];
            string primarytablefiled        = Request["primarytablefiled"];
            string secondtableprimarykey    = Request["secondtableprimarykey"];
            string primarytablefiledvalue   = Request["primarytablefiledvalue"];
            string secondtablerelationfield = Request["secondtablerelationfield"];
            string dbconnid = Request["dbconnid"];

            LitJson.JsonData data = new BizProcess.Platform.WorkFlow().GetSubTableData(dbconnid, secondtable, secondtablerelationfield, primarytablefiledvalue, secondtableprimarykey);
            return(data.ToJson());
        }
        public ActionResult CompletedList(FormCollection collection)
        {
            BizProcess.Platform.WorkFlowTask bworkFlowTask = new BizProcess.Platform.WorkFlowTask();
            BizProcess.Platform.WorkFlow     bworkFlow     = new BizProcess.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(BizProcess.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));
        }
        public ActionResult DetailSubFlow()
        {
            BizProcess.Platform.WorkFlowTask bworkFlowTask = new BizProcess.Platform.WorkFlowTask();
            BizProcess.Platform.WorkFlow     bworkFlow     = new BizProcess.Platform.WorkFlow();

            string query = 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}",
                                         Request.QueryString["flowid"],
                                         Request.QueryString["groupid"],
                                         Request.QueryString["appid"],
                                         Request.QueryString["tabid"],
                                         Request.QueryString["title"].UrlEncode(),
                                         Request.QueryString["flowid"],
                                         Request.QueryString["sender"],
                                         Request.QueryString["date1"],
                                         Request.QueryString["date2"],
                                         Request.QueryString["iframeid"],
                                         Request.QueryString["openerid"],
                                         Request.QueryString["taskid"]
                                         );

            ViewBag.flowid       = Request.QueryString["flowid"];
            ViewBag.groupid      = Request.QueryString["groupid"];
            ViewBag.displayModel = Request.QueryString["displaymodel"];
            ViewBag.wfInstall    = null;
            ViewBag.query        = query;

            string taskid       = Request.QueryString["taskid"];
            string displayModel = Request.QueryString["displaymodel"];

            if (!taskid.IsGuid())
            {
                return(View(new List <BizProcess.Data.Model.WorkFlowTask>()));
            }
            var task = bworkFlowTask.Get(taskid.ToGuid());

            if (task == null || !task.SubFlowGroupID.HasValue)
            {
                return(View(new List <BizProcess.Data.Model.WorkFlowTask>()));
            }
            var subFlowTasks = bworkFlowTask.GetTaskList(Guid.Empty, task.SubFlowGroupID.Value);

            if (subFlowTasks.Count == 0)
            {
                return(View(new List <BizProcess.Data.Model.WorkFlowTask>()));
            }

            var wfInstall = bworkFlow.GetWorkFlowRunModel(subFlowTasks.First().FlowID);
            var tasks     = subFlowTasks.OrderBy(p => p.Sort);

            ViewBag.wfInstall = wfInstall;
            ViewBag.flowid    = subFlowTasks.First().FlowID.ToString();
            return(View(tasks));
        }
        public ActionResult Index(FormCollection collection)
        {
            BizProcess.Platform.WorkFlowDelegation bworkFlowDelegation = new BizProcess.Platform.WorkFlowDelegation();
            BizProcess.Platform.Organize           borganize           = new BizProcess.Platform.Organize();
            BizProcess.Platform.Users    busers    = new BizProcess.Platform.Users();
            BizProcess.Platform.WorkFlow bworkFlow = new BizProcess.Platform.WorkFlow();
            IEnumerable <BizProcess.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);
                            BizProcess.Platform.Log.Add("删除了流程意见", comment.Serialize(), BizProcess.Platform.Log.Types.流程相关);
                        }
                    }
                    bworkFlowDelegation.RefreshCache();
                }
            }

            string pager;
            bool   isOneSelf = "1" == Request.QueryString["isoneself"];

            if (isOneSelf)
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, query1, BizProcess.Platform.Users.CurrentUserID.ToString(), startTime, endTime);
            }
            else
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, query1, "", startTime, endTime);
            }
            ViewBag.Query1 = query1;
            return(View(workFlowDelegationList));
        }
        public string GetJSON()
        {
            string flowid = Request.QueryString["flowid"];
            string type   = Request.QueryString["type"];

            if (!flowid.IsGuid())
            {
                return("{}");
            }
            var flow = new BizProcess.Platform.WorkFlow().Get(flowid.ToGuid());

            if (flow == null)
            {
                return("{}");
            }
            else
            {
                return("0" == type ? flow.RunJSON : flow.DesignJSON);
            }
        }
        public ActionResult Open_List(FormCollection collection)
        {
            BizProcess.Platform.WorkFlow bwf = new BizProcess.Platform.WorkFlow();
            string name = string.Empty;
            string type = Request.QueryString["typeid"];

            if (collection != null)
            {
                name = Request.Form["flow_name"];
            }

            IEnumerable <BizProcess.Data.Model.WorkFlow> flows = bwf.GetAll().Where(p => p.Status != 4);

            if (!name.IsNullOrEmpty())
            {
                flows = flows.Where(p => p.Name.IndexOf(name) >= 0);
            }
            ViewBag.Name = name;
            return(View(flows));
        }
Beispiel #7
0
        public ActionResult List(FormCollection collection)
        {
            string appid  = Request.QueryString["appid"];
            string tabid  = Request.QueryString["tabid"];
            string typeid = Request.QueryString["typeid"];
            string title  = string.Empty;

            BizProcess.Platform.WorkFlowArchives BWFA = new BizProcess.Platform.WorkFlowArchives();
            BizProcess.Platform.WorkFlow         BWF  = new BizProcess.Platform.WorkFlow();
            if (collection != null)
            {
                title = Request.Form["Title"];
            }
            else
            {
                title = Request.QueryString["Title"];
            }

            string query = string.Format("&appid={0}&tabid={1}&Title={2}&typeid={3}",
                                         Request.QueryString["appid"],
                                         Request.QueryString["tabid"],
                                         title.UrlEncode(), typeid
                                         );
            string query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]);
            string pager;

            System.Data.DataTable Dt = BWFA.GetPagerData(out pager, query, title, BWF.GetFlowIDFromType(typeid.ToGuid()));

            ViewBag.Pager  = pager;
            ViewBag.Title1 = title;
            ViewBag.appid  = appid;
            ViewBag.tabid  = tabid;
            ViewBag.typeid = typeid;
            ViewBag.Query1 = query1;

            return(View(Dt));
        }
        public ActionResult Detail()
        {
            BizProcess.Platform.WorkFlowTask bworkFlowTask = new BizProcess.Platform.WorkFlowTask();
            BizProcess.Platform.WorkFlow     bworkFlow     = new BizProcess.Platform.WorkFlow();

            string flowid       = Request.QueryString["flowid1"] ?? Request.QueryString["flowid"];
            string groupid      = Request.QueryString["groupid"];
            string displayModel = Request.QueryString["displaymodel"];

            if (displayModel.IsNullOrEmpty())
            {
                displayModel = "1";
            }

            var    wfInstall = bworkFlow.GetWorkFlowRunModel(flowid);
            var    tasks     = bworkFlowTask.GetTaskList(flowid.ToGuid(), groupid.ToGuid()).OrderBy(p => p.Sort);
            string query     = string.Format("&flowid1={0}&groupid={1}&appid={2}&tabid={3}&title={4}&flowid={5}&sender={6}&date1={7}&date2={8}&iframeid={9}&openerid={10}",
                                             flowid, groupid,
                                             Request.QueryString["appid"],
                                             Request.QueryString["tabid"],
                                             Request.QueryString["title"].UrlEncode(),
                                             Request.QueryString["flowid"],
                                             Request.QueryString["sender"],
                                             Request.QueryString["date1"],
                                             Request.QueryString["date2"],
                                             Request.QueryString["iframeid"],
                                             Request.QueryString["openerid"]
                                             );

            ViewBag.flowid       = flowid;
            ViewBag.groupid      = groupid;
            ViewBag.displayModel = displayModel;
            ViewBag.wfInstall    = wfInstall;
            ViewBag.query        = query;
            return(View(tasks));
        }
        public ActionResult instanceList1(FormCollection collection)
        {
            BizProcess.Platform.WorkFlowTask bworkFlowTask = new BizProcess.Platform.WorkFlowTask();
            BizProcess.Platform.WorkFlow     bworkFlow     = new BizProcess.Platform.WorkFlow();

            string title  = "";
            string flowid = "";
            string sender = "";
            string date1  = "";
            string date2  = "";
            string status = "";
            string typeid = Request.QueryString["typeid"];

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

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

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

            string pager;

            List <SelectListItem> statusItems = new List <SelectListItem>();

            statusItems.Add(new SelectListItem()
            {
                Text = "==全部==", Value = "0", Selected = "0" == status
            });
            statusItems.Add(new SelectListItem()
            {
                Text = "未完成", Value = "1", Selected = "1" == status
            });
            statusItems.Add(new SelectListItem()
            {
                Text = "已完成", Value = "2", Selected = "2" == status
            });



            //可管理的流程ID数组
            var         flows   = bworkFlow.GetInstanceManageFlowIDList(BizProcess.Platform.Users.CurrentUserID, typeid);
            List <Guid> flowids = new List <Guid>();

            foreach (var flow in flows.OrderBy(p => p.Value))
            {
                flowids.Add(flow.Key);
            }
            Guid[] manageFlows = flowids.ToArray();

            string flowOptions = bworkFlow.GetOptions(flows, typeid, flowid);

            var taskList = bworkFlowTask.GetInstances(manageFlows, new Guid[] { },
                                                      sender.IsNullOrEmpty() ? new Guid[] { } : new Guid[] { sender.Replace(BizProcess.Platform.Users.PREFIX, "").ToGuid() },
                                                      out pager, query1, title, flowid, date1, date2, status.ToInt());

            ViewBag.Query       = query;
            ViewBag.Pager       = pager;
            ViewBag.StatusItems = statusItems;
            ViewBag.Title1      = title;
            ViewBag.FlowOptions = flowOptions;
            ViewBag.Sender      = sender;
            ViewBag.Date1       = date1;
            ViewBag.Date2       = date2;

            return(View(taskList));
        }