Esempio n. 1
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            MyCreek.Data.Model.WorkFlowCustomEventParams parmas = new MyCreek.Data.Model.WorkFlowCustomEventParams();
            string instanceid1 = new MyCreek.Platform.WorkFlow().SaveFromData(Request.QueryString["instanceid"], parmas);

            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "ok", "alert('保存成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true);
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            appid  = Request.QueryString["appid"];
            tabid  = Request.QueryString["tabid"];
            typeid = Request.QueryString["typeid"];
            title  = string.Empty;

            MyCreek.Platform.WorkFlowArchives BWFA = new MyCreek.Platform.WorkFlowArchives();
            MyCreek.Platform.WorkFlow         BWF  = new MyCreek.Platform.WorkFlow();
            if (IsPostBack)
            {
                title = Request.Form["Title1"];
            }
            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
                                         );

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

            Dt = BWFA.GetPagerData(out pager, query, title, BWF.GetFlowIDFromType(typeid.ToGuid()));
            this.Pager.Text = pager;
        }
Esempio n. 3
0
        public ActionResult Detail()
        {
            MyCreek.Platform.WorkFlowTask bworkFlowTask = new MyCreek.Platform.WorkFlowTask();
            MyCreek.Platform.WorkFlow     bworkFlow     = new MyCreek.Platform.WorkFlow();

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

            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));
        }
Esempio n. 4
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string json = context.Request.Form["json"];
            string msg  = new MyCreek.Platform.WorkFlow().SaveFlow(json);

            MyCreek.Platform.Log.Add("保存了流程", json + "(" + msg + ")", MyCreek.Platform.Log.Types.流程相关);
            context.Response.Write(msg);
        }
Esempio n. 5
0
        public ActionResult DetailSubFlow()
        {
            MyCreek.Platform.WorkFlowTask bworkFlowTask = new MyCreek.Platform.WorkFlowTask();
            MyCreek.Platform.WorkFlow     bworkFlow     = new MyCreek.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 <MyCreek.Data.Model.WorkFlowTask>()));
            }
            var task = bworkFlowTask.Get(taskid.ToGuid());

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

            if (subFlowTasks.Count == 0)
            {
                return(View(new List <MyCreek.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));
        }
Esempio n. 6
0
        public ActionResult CompletedList(FormCollection collection)
        {
            MyCreek.Platform.WorkFlowTask bworkFlowTask = new MyCreek.Platform.WorkFlowTask();
            MyCreek.Platform.WorkFlow     bworkFlow     = new MyCreek.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(MyCreek.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 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 MyCreek.Platform.WorkFlow().GetSubTableData(dbconnid, secondtable, secondtablerelationfield, primarytablefiledvalue, secondtableprimarykey);
            return(data.ToJson());
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string flowid = Request.QueryString["flowid"];

            if (IsPostBack && flowid.IsGuid() && !Request.Form["save"].IsNullOrEmpty())
            {
                string newName = Request.Form["NewFlowName"];
                saveOpen = Request.Form["SaveOpen"];
                var wf = new MyCreek.Platform.WorkFlow().SaveAs(flowid.ToGuid(), newName);
                if (wf != null)
                {
                    newid = wf.ID.ToString();
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('另存成功!');", true);
                }
            }
        }
Esempio n. 9
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string id   = context.Request.Form["id"];
            string type = context.Request.Form["type"];

            MyCreek.Platform.WorkFlow bworkFlow = new MyCreek.Platform.WorkFlow();
            var flow = bworkFlow.Get(id.ToGuid());

            if (flow == null)
            {
                context.Response.Write("该流程还未保存!");
                context.Response.End();
            }
            else
            {
                if ("0" == type)
                {
                    flow.Status = 3;
                    bworkFlow.Update(flow);
                    bworkFlow.RefreshWrokFlowCache(flow.ID);
                    MyCreek.Platform.Log.Add("卸载了流程", flow.Serialize(), MyCreek.Platform.Log.Types.流程相关);
                    context.Response.Write("1");
                    context.Response.End();
                }
                else if ("1" == type)
                {
                    flow.Status = 4;
                    bworkFlow.Update(flow);
                    //bworkFlow.ClearWorkFlowCache(flow.ID);
                    MyCreek.Platform.AppLibrary APP = new MyCreek.Platform.AppLibrary();
                    var app = APP.GetByCode(flow.ID.ToString());
                    if (app != null)
                    {
                        APP.Delete(app.ID);
                        new MyCreek.Platform.RoleApp().DeleteByAppID(app.ID);
                    }
                    MyCreek.Platform.Log.Add("删除了流程", flow.Serialize(), MyCreek.Platform.Log.Types.流程相关);

                    context.Response.Write("1");
                    context.Response.End();
                }
            }
        }
        public string GetJSON()
        {
            string flowid = Request.QueryString["flowid"];
            string type   = Request.QueryString["type"];

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

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

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

            IEnumerable <MyCreek.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));
        }
Esempio n. 12
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string flowid = context.Request.QueryString["flowid"];
            string type   = context.Request.QueryString["type"];

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

            if (flow == null)
            {
                context.Response.Write("{}");
            }
            else
            {
                context.Response.Write("0" == type ? flow.RunJSON : flow.DesignJSON);
            }
        }
        public ActionResult List(FormCollection collection)
        {
            string appid  = Request.QueryString["appid"];
            string tabid  = Request.QueryString["tabid"];
            string typeid = Request.QueryString["typeid"];
            string title  = string.Empty;

            MyCreek.Platform.WorkFlowArchives BWFA = new MyCreek.Platform.WorkFlowArchives();
            MyCreek.Platform.WorkFlow         BWF  = new MyCreek.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 Index(FormCollection collection)
        {
            MyCreek.Platform.WorkFlowDelegation bworkFlowDelegation = new MyCreek.Platform.WorkFlowDelegation();
            MyCreek.Platform.Organize           borganize           = new MyCreek.Platform.Organize();
            MyCreek.Platform.Users    busers    = new MyCreek.Platform.Users();
            MyCreek.Platform.WorkFlow bworkFlow = new MyCreek.Platform.WorkFlow();
            IEnumerable <MyCreek.Data.Model.WorkFlowDelegation> workFlowDelegationList;

            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 (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);
                            MyCreek.Platform.Log.Add("删除了流程意见", comment.Serialize(), MyCreek.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, MyCreek.Platform.Users.CurrentUserID.ToString(), startTime, endTime);
            }
            else
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, query1, MyCreek.Platform.Users.RemovePrefix(suserid), startTime, endTime);
            }
            ViewBag.Query1    = query1;
            ViewBag.startTime = startTime;
            ViewBag.endTime   = endTime;
            ViewBag.suserid   = suserid;
            return(View(workFlowDelegationList));
        }
Esempio n. 15
0
        public ActionResult instanceList1(FormCollection collection)
        {
            MyCreek.Platform.WorkFlowTask bworkFlowTask = new MyCreek.Platform.WorkFlowTask();
            MyCreek.Platform.WorkFlow     bworkFlow     = new MyCreek.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}&typeid={8}",
                                          Request.QueryString["appid"], Request.QueryString["tabid"], title.UrlEncode(), flowid, sender, date1, date2, status, typeid);

            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(MyCreek.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(MyCreek.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));
        }
Esempio n. 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            isoneself = "1" == Request.QueryString["isoneself"];
            if (isoneself)
            {
                this.S_UserID.Disabled = true;
                this.S_UserID.Value    = MyCreek.Platform.Users.PREFIX + MyCreek.Platform.Users.CurrentUserID.ToString();
            }
            MyCreek.Platform.WorkFlowDelegation bworkFlowDelegation = new MyCreek.Platform.WorkFlowDelegation();
            MyCreek.Platform.Organize           borganize           = new MyCreek.Platform.Organize();
            MyCreek.Platform.Users    busers    = new MyCreek.Platform.Users();
            MyCreek.Platform.WorkFlow bworkFlow = new MyCreek.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);
                            MyCreek.Platform.Log.Add("删除了流程意见", comment.Serialize(), MyCreek.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, MyCreek.Platform.Users.CurrentUserID.ToString(), startTime, endTime);
            }
            else
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, Query1, MyCreek.Platform.Users.RemovePrefix(suserid), startTime, endTime);
            }
            this.Pager.Text = pager;
        }