示例#1
0
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowComment   bworkFlowComment = new RoadFlow.Platform.WorkFlowComment();
            RoadFlow.Data.Model.WorkFlowComment workFlowComment  = null;
            string id = Request.QueryString["id"];

            string member  = string.Empty;
            string comment = string.Empty;
            string sort    = string.Empty;

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

            Guid commentID;

            if (id.IsGuid(out commentID))
            {
                workFlowComment = bworkFlowComment.Get(commentID);
                member          = workFlowComment.MemberID;
                comment         = workFlowComment.Comment;
                sort            = workFlowComment.Sort.ToString();
            }
            string oldXML = workFlowComment.Serialize();

            if (collection != null)
            {
                member  = isOneSelf ? RoadFlow.Platform.UsersBLL.PREFIX + RoadFlow.Platform.UsersBLL.CurrentUserID.ToString() : Request.Form["Member"];
                comment = Request.Form["Comment"];
                sort    = Request.Form["Sort"];

                bool isAdd = !id.IsGuid();
                if (workFlowComment == null)
                {
                    workFlowComment      = new RoadFlow.Data.Model.WorkFlowComment();
                    workFlowComment.ID   = Guid.NewGuid();
                    workFlowComment.Type = isOneSelf ? 1 : 0;
                }

                workFlowComment.MemberID = member.IsNullOrEmpty() ? "" : member.Trim();
                workFlowComment.Comment  = comment.IsNullOrEmpty() ? "" : comment.Trim();
                workFlowComment.Sort     = sort.IsInt() ? sort.Convert <int>() : bworkFlowComment.GetManagerMaxSort();


                if (isAdd)
                {
                    bworkFlowComment.Add(workFlowComment);
                    RoadFlow.Platform.Log.Add("添加了流程意见", workFlowComment.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    bworkFlowComment.Update(workFlowComment);
                    RoadFlow.Platform.Log.Add("修改了流程意见", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowComment.Serialize());
                }
                bworkFlowComment.RefreshCache();
                ViewBag.Script = "new RoadUI.Window().reloadOpener();alert('保存成功!');";
            }
            return(View(workFlowComment == null ? new RoadFlow.Data.Model.WorkFlowComment() : workFlowComment));
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RoadFlow.Platform.WorkFlowComment   bworkFlowComment = new RoadFlow.Platform.WorkFlowComment();
            RoadFlow.Data.Model.WorkFlowComment workFlowComment  = null;
            string id = Request.QueryString["id"];

            string member  = string.Empty;
            string comment = string.Empty;
            string sort    = string.Empty;

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

            if (isOneSelf)
            {
                this.usermemberid.Visible = false;
            }
            Guid commentID;

            if (id.IsGuid(out commentID))
            {
                workFlowComment = bworkFlowComment.Get(commentID);
                member          = workFlowComment.MemberID;
                comment         = workFlowComment.Comment;
                sort            = workFlowComment.Sort.ToString();
            }

            string oldXML = workFlowComment.Serialize();

            if (IsPostBack)
            {
                member  = isOneSelf ? RoadFlow.Platform.Users.PREFIX + RoadFlow.Platform.Users.CurrentUserID.ToString() : Request.Form["Member"];
                comment = Request.Form["Comment"];
                sort    = Request.Form["Sort"];

                bool isAdd = !id.IsGuid();
                if (workFlowComment == null)
                {
                    workFlowComment      = new RoadFlow.Data.Model.WorkFlowComment();
                    workFlowComment.ID   = Guid.NewGuid();
                    workFlowComment.Type = isOneSelf ? 1 : 0;
                }

                workFlowComment.MemberID = member.IsNullOrEmpty() ? "" : member.Trim();
                workFlowComment.Comment  = comment.IsNullOrEmpty() ? "" : comment.Trim();
                workFlowComment.Sort     = sort.IsInt() ? sort.ToInt() : bworkFlowComment.GetManagerMaxSort();

                if (isAdd)
                {
                    bworkFlowComment.Add(workFlowComment);
                    RoadFlow.Platform.Log.Add("添加了流程意见", workFlowComment.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    bworkFlowComment.Update(workFlowComment);
                    RoadFlow.Platform.Log.Add("修改了流程意见", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowComment.Serialize());
                }
                bworkFlowComment.RefreshCache();
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "new RoadUI.Window().reloadOpener();alert('保存成功!'); new RoadUI.Window().close();", true);
            }

            if (workFlowComment != null)
            {
                this.Comment.Value = workFlowComment.Comment;
                this.Member.Value  = workFlowComment.MemberID;
                this.Sort.Value    = workFlowComment.Sort.ToString();
            }
        }
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowComment   workFlowComment = new RoadFlow.Platform.WorkFlowComment();
            RoadFlow.Data.Model.WorkFlowComment model           = (RoadFlow.Data.Model.WorkFlowComment)null;
            string str1  = this.Request.QueryString["id"];
            string str2  = string.Empty;
            string str3  = string.Empty;
            string empty = string.Empty;
            bool   flag  = "1" == this.Request.QueryString["isoneself"];
            Guid   test;

            if (str1.IsGuid(out test))
            {
                model = workFlowComment.Get(test);
                str2  = model.MemberID;
                str3  = model.Comment;
                empty = model.Sort.ToString();
            }
            string oldXML = model.Serialize();

            if (collection != null)
            {
                string str4 = flag ? "u_" + RoadFlow.Platform.Users.CurrentUserID.ToString() : this.Request.Form["Member"];
                string str5 = this.Request.Form["Comment"];
                string str6 = this.Request.Form["Sort"];
                int    num  = !str1.IsGuid() ? 1 : 0;
                if (model == null)
                {
                    model      = new RoadFlow.Data.Model.WorkFlowComment();
                    model.ID   = Guid.NewGuid();
                    model.Type = flag ? 1 : 0;
                }
                model.MemberID = str4.IsNullOrEmpty() ? "" : str4.Trim();
                model.Comment  = str5.IsNullOrEmpty() ? "" : str5.Trim();
                model.Sort     = str6.IsInt() ? str6.ToInt() : workFlowComment.GetManagerMaxSort();
                if (num != 0)
                {
                    workFlowComment.Add(model);
                    RoadFlow.Platform.Log.Add("添加了流程意见", model.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null);
                }
                else
                {
                    workFlowComment.Update(model);
                    RoadFlow.Platform.Log.Add("修改了流程意见", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null);
                }
                workFlowComment.RefreshCache();
                // ISSUE: reference to a compiler-generated field
                if (WorkFlowCommentsController.\u003C\u003Eo__4.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    WorkFlowCommentsController.\u003C\u003Eo__4.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(WorkFlowCommentsController), (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 = WorkFlowCommentsController.\u003C\u003Eo__4.\u003C\u003Ep__0.Target((CallSite)WorkFlowCommentsController.\u003C\u003Eo__4.\u003C\u003Ep__0, this.ViewBag, "new RoadUI.Window().reloadOpener();alert('保存成功!');");
            }
            if (model == null)
            {
                model      = new RoadFlow.Data.Model.WorkFlowComment();
                model.Sort = workFlowComment.GetManagerMaxSort() + 5;
            }
            return((ActionResult)this.View((object)model));
        }