public ActionResult Index(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowDelegation bworkFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation();
            RoadFlow.Platform.Organize           borganize           = new RoadFlow.Platform.Organize();
            RoadFlow.Platform.UsersBLL           busers    = new RoadFlow.Platform.UsersBLL();
            RoadFlow.Platform.WorkFlow           bworkFlow = new RoadFlow.Platform.WorkFlow();
            IEnumerable <RoadFlow.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);
                            RoadFlow.Platform.Log.Add("删除了流程意见", comment.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                        }
                    }
                    bworkFlowDelegation.RefreshCache();
                }
            }

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

            if (isOneSelf)
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, query1, RoadFlow.Platform.UsersBLL.CurrentUserID.ToString(), startTime, endTime);
            }
            else
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, query1, "", startTime, endTime);
            }
            ViewBag.Query1 = query1;
            return(View(workFlowDelegationList));
        }
        public string Delete()
        {
            RoadFlow.Platform.WorkFlowDelegation workFlowDelegation1 = new RoadFlow.Platform.WorkFlowDelegation();
            string str1 = this.Request.Form["ids"];

            char[] chArray = new char[1] {
                ','
            };
            foreach (string str2 in str1.Split(chArray))
            {
                Guid test;
                if (str2.IsGuid(out test))
                {
                    RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 = workFlowDelegation1.Get(test);
                    if (workFlowDelegation2 != null)
                    {
                        workFlowDelegation1.Delete(test);
                        RoadFlow.Platform.Log.Add("删除了流程意见", workFlowDelegation2.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null);
                    }
                }
            }
            workFlowDelegation1.RefreshCache();
            return("删除成功!");
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];

            string UserID    = string.Empty;
            string ToUserID  = string.Empty;
            string StartTime = string.Empty;
            string EndTime   = string.Empty;
            string FlowID    = string.Empty;
            string Note      = string.Empty;

            isOneSelf = "1" == Request.QueryString["isoneself"];

            Guid delegationID;

            if (id.IsGuid(out delegationID))
            {
                workFlowDelegation = bworkFlowDelegation.Get(delegationID);
                if (workFlowDelegation != null)
                {
                    FlowID = workFlowDelegation.FlowID.ToString();
                }
            }
            string oldXML = workFlowDelegation.Serialize();

            if (IsPostBack)
            {
                UserID    = Request.Form["UserID"];
                ToUserID  = Request.Form["ToUserID"];
                StartTime = Request.Form["StartTime"];
                EndTime   = Request.Form["EndTime"];
                FlowID    = Request.Form["FlowID"];
                Note      = Request.Form["Note"];

                bool isAdd = !id.IsGuid();
                if (workFlowDelegation == null)
                {
                    workFlowDelegation    = new RoadFlow.Data.Model.WorkFlowDelegation();
                    workFlowDelegation.ID = Guid.NewGuid();
                }
                workFlowDelegation.UserID  = isOneSelf ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(UserID).ToGuid();
                workFlowDelegation.EndTime = EndTime.ToDateTime();
                if (FlowID.IsGuid())
                {
                    workFlowDelegation.FlowID = FlowID.ToGuid();
                }
                workFlowDelegation.Note      = Note.IsNullOrEmpty() ? null : Note;
                workFlowDelegation.StartTime = StartTime.ToDateTime();
                workFlowDelegation.ToUserID  = RoadFlow.Platform.Users.RemovePrefix(ToUserID).ToGuid();
                workFlowDelegation.WriteTime = RoadFlow.Utility.DateTimeNew.Now;

                if (isAdd)
                {
                    bworkFlowDelegation.Add(workFlowDelegation);
                    RoadFlow.Platform.Log.Add("添加了工作委托", workFlowDelegation.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    bworkFlowDelegation.Update(workFlowDelegation);
                    RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowDelegation.Serialize());
                }
                bworkFlowDelegation.RefreshCache();
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "alert('保存成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();", true);
            }
            FlowOptions = new RoadFlow.Platform.WorkFlow().GetOptions(FlowID);
            if (workFlowDelegation == null)
            {
                workFlowDelegation = new RoadFlow.Data.Model.WorkFlowDelegation();
            }
        }
Ejemplo n.º 4
0
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowDelegation   bworkFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation();
            RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation  = null;
            string id = Request.QueryString["id"];

            string UserID    = string.Empty;
            string ToUserID  = string.Empty;
            string StartTime = string.Empty;
            string EndTime   = string.Empty;
            string FlowID    = string.Empty;
            string Note      = string.Empty;

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

            Guid delegationID;

            if (id.IsGuid(out delegationID))
            {
                workFlowDelegation = bworkFlowDelegation.Get(delegationID);
                if (workFlowDelegation != null)
                {
                    FlowID = workFlowDelegation.FlowID.ToString();
                }
            }
            string oldXML = workFlowDelegation.Serialize();

            if (collection != null)
            {
                UserID    = Request.Form["UserID"];
                ToUserID  = Request.Form["ToUserID"];
                StartTime = Request.Form["StartTime"];
                EndTime   = Request.Form["EndTime"];
                FlowID    = Request.Form["FlowID"];
                Note      = Request.Form["Note"];

                bool isAdd = !id.IsGuid();
                if (workFlowDelegation == null)
                {
                    workFlowDelegation    = new RoadFlow.Data.Model.WorkFlowDelegation();
                    workFlowDelegation.ID = Guid.NewGuid();
                }
                workFlowDelegation.UserID  = isOneSelf ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(UserID).ToGuid();
                workFlowDelegation.EndTime = EndTime.ToDateTime();
                if (FlowID.IsGuid())
                {
                    workFlowDelegation.FlowID = FlowID.ToGuid();
                }
                workFlowDelegation.Note      = Note.IsNullOrEmpty() ? null : Note;
                workFlowDelegation.StartTime = StartTime.ToDateTime();
                workFlowDelegation.ToUserID  = RoadFlow.Platform.Users.RemovePrefix(ToUserID).ToGuid();
                workFlowDelegation.WriteTime = RoadFlow.Utility.DateTimeNew.Now;



                if (isAdd)
                {
                    bworkFlowDelegation.Add(workFlowDelegation);
                    RoadFlow.Platform.Log.Add("添加了工作委托", workFlowDelegation.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    bworkFlowDelegation.Update(workFlowDelegation);
                    RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowDelegation.Serialize());
                }
                bworkFlowDelegation.RefreshCache();
                ViewBag.Script = "alert('保存成功!');new RoadUI.Window().reloadOpener();new RoadUI.Window().close();";
            }
            ViewBag.FlowOptions = new RoadFlow.Platform.WorkFlow().GetOptions(FlowID);
            return(View(workFlowDelegation == null ? new RoadFlow.Data.Model.WorkFlowDelegation()
            {
                UserID = RoadFlow.Platform.Users.CurrentUserID
            } : workFlowDelegation));
        }
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowDelegation   workFlowDelegation1 = new RoadFlow.Platform.WorkFlowDelegation();
            RoadFlow.Data.Model.WorkFlowDelegation model = (RoadFlow.Data.Model.WorkFlowDelegation)null;
            string str1   = this.Request.QueryString["id"];
            string empty1 = string.Empty;
            string empty2 = string.Empty;
            string empty3 = string.Empty;
            string empty4 = string.Empty;
            string empty5 = string.Empty;
            string empty6 = string.Empty;
            bool   flag   = "1" == this.Request.QueryString["isoneself"];
            Guid   test;
            Guid?  nullable1;

            if (str1.IsGuid(out test))
            {
                model = workFlowDelegation1.Get(test);
                if (model != null)
                {
                    nullable1 = model.FlowID;
                    empty5    = nullable1.ToString();
                }
            }
            string oldXML = model.Serialize();

            if (collection != null)
            {
                string id1  = this.Request.Form["UserID"];
                string id2  = this.Request.Form["ToUserID"];
                string str2 = this.Request.Form["StartTime"];
                string str3 = this.Request.Form["EndTime"];
                empty5 = this.Request.Form["FlowID"];
                string str4 = this.Request.Form["Note"];
                int    num  = !str1.IsGuid() ? 1 : 0;
                if (model == null)
                {
                    model    = new RoadFlow.Data.Model.WorkFlowDelegation();
                    model.ID = Guid.NewGuid();
                }
                model.UserID  = flag ? RoadFlow.Platform.Users.CurrentUserID : RoadFlow.Platform.Users.RemovePrefix(id1).ToGuid();
                model.EndTime = str3.ToDateTime();
                if (empty5.IsGuid())
                {
                    model.FlowID = new Guid?(empty5.ToGuid());
                }
                else
                {
                    RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation2 = model;
                    nullable1 = new Guid?();
                    Guid?nullable2 = nullable1;
                    workFlowDelegation2.FlowID = nullable2;
                }
                model.Note      = str4.IsNullOrEmpty() ? (string)null : str4;
                model.StartTime = str2.ToDateTime();
                model.ToUserID  = RoadFlow.Platform.Users.RemovePrefix(id2).ToGuid();
                model.WriteTime = DateTimeNew.Now;
                if (num != 0)
                {
                    workFlowDelegation1.Add(model);
                    RoadFlow.Platform.Log.Add("添加了工作委托", model.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null);
                }
                else
                {
                    workFlowDelegation1.Update(model);
                    RoadFlow.Platform.Log.Add("修改了工作委托", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null);
                }
                workFlowDelegation1.RefreshCache();
                // ISSUE: reference to a compiler-generated field
                if (WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(WorkFlowDelegationController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                    {
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                        CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, (string)null)
                    }));
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                object obj = WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0.Target((CallSite)WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__0, this.ViewBag, "alert('保存成功!');new RoadUI.Window().getOpenerWindow().query();new RoadUI.Window().close();");
            }
            // ISSUE: reference to a compiler-generated field
            if (WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1 == null)
            {
                // ISSUE: reference to a compiler-generated field
                WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "FlowOptions", typeof(WorkFlowDelegationController), (IEnumerable <CSharpArgumentInfo>) new CSharpArgumentInfo[2]
                {
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string)null),
                    CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, (string)null)
                }));
            }
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            object obj1 = WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1.Target((CallSite)WorkFlowDelegationController.\u003C\u003Eo__4.\u003C\u003Ep__1, this.ViewBag, new RoadFlow.Platform.WorkFlow().GetOptions(empty5));

            RoadFlow.Data.Model.WorkFlowDelegation workFlowDelegation3;
            if (model != null)
            {
                workFlowDelegation3 = model;
            }
            else
            {
                workFlowDelegation3        = new RoadFlow.Data.Model.WorkFlowDelegation();
                workFlowDelegation3.UserID = RoadFlow.Platform.Users.CurrentUserID;
            }
            return((ActionResult)this.View((object)workFlowDelegation3));
        }
Ejemplo n.º 6
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    = RoadFlow.Platform.Users.PREFIX + RoadFlow.Platform.Users.CurrentUserID.ToString();
            }
            RoadFlow.Platform.WorkFlowDelegation bworkFlowDelegation = new RoadFlow.Platform.WorkFlowDelegation();
            RoadFlow.Platform.Organize           borganize           = new RoadFlow.Platform.Organize();
            RoadFlow.Platform.Users    busers    = new RoadFlow.Platform.Users();
            RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.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);
                            RoadFlow.Platform.Log.Add("删除了流程意见", comment.Serialize(), RoadFlow.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, RoadFlow.Platform.Users.CurrentUserID.ToString(), startTime, endTime);
            }
            else
            {
                workFlowDelegationList = bworkFlowDelegation.GetPagerData(out pager, Query1, RoadFlow.Platform.Users.RemovePrefix(suserid), startTime, endTime);
            }
            this.Pager.Text = pager;
        }