Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RoadFlow.Platform.WorkFlowButtons   bworkFlowButtons = new RoadFlow.Platform.WorkFlowButtons();
            RoadFlow.Data.Model.WorkFlowButtons workFlowButton   = null;
            string id = Request.QueryString["id"];

            string title  = string.Empty;
            string ico    = string.Empty;
            string script = string.Empty;
            string note   = string.Empty;

            Guid buttionID;

            if (id.IsGuid(out buttionID))
            {
                workFlowButton = bworkFlowButtons.Get(buttionID);
            }
            string oldXML = workFlowButton.Serialize();

            if (IsPostBack)
            {
                title  = Request.Form["Title1"];
                ico    = Request.Form["Ico"];
                script = Request.Form["Script"];
                note   = Request.Form["Note"];

                bool isAdd = !id.IsGuid();
                if (workFlowButton == null)
                {
                    workFlowButton      = new RoadFlow.Data.Model.WorkFlowButtons();
                    workFlowButton.ID   = Guid.NewGuid();
                    workFlowButton.Sort = bworkFlowButtons.GetMaxSort();
                }

                workFlowButton.Ico    = ico.IsNullOrEmpty() ? null : ico.Trim();
                workFlowButton.Note   = note.IsNullOrEmpty() ? null : note.Trim();
                workFlowButton.Script = script.IsNullOrEmpty() ? null : script;
                workFlowButton.Title  = title.Trim();

                if (isAdd)
                {
                    bworkFlowButtons.Add(workFlowButton);
                    RoadFlow.Platform.Log.Add("添加了流程按钮", workFlowButton.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    bworkFlowButtons.Update(workFlowButton);
                    RoadFlow.Platform.Log.Add("修改了流程按钮", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowButton.Serialize());
                }
                bworkFlowButtons.ClearCache();
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "ok", "new RoadUI.Window().reloadOpener();alert('保存成功!');new RoadUI.Window().close();", true);
            }
            if (workFlowButton != null)
            {
                this.Title1.Value = workFlowButton.Title;
                this.Ico.Value    = workFlowButton.Ico;
                this.Script.Value = workFlowButton.Script;
                this.Note.Value   = workFlowButton.Note;
            }
        }
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowButtons   bworkFlowButtons = new RoadFlow.Platform.WorkFlowButtons();
            RoadFlow.Data.Model.WorkFlowButtons workFlowButton   = null;
            string id = Request.QueryString["id"];

            string title  = string.Empty;
            string ico    = string.Empty;
            string script = string.Empty;
            string note   = string.Empty;

            Guid buttionID;

            if (id.IsGuid(out buttionID))
            {
                workFlowButton = bworkFlowButtons.Get(buttionID);
            }
            string oldXML = workFlowButton.Serialize();

            if (collection != null)
            {
                title  = Request.Form["Title"];
                ico    = Request.Form["Ico"];
                script = Request.Form["Script"];
                note   = Request.Form["Note"];

                bool isAdd = !id.IsGuid();
                if (workFlowButton == null)
                {
                    workFlowButton      = new RoadFlow.Data.Model.WorkFlowButtons();
                    workFlowButton.ID   = Guid.NewGuid();
                    workFlowButton.Sort = bworkFlowButtons.GetMaxSort();
                }

                workFlowButton.Ico    = ico.IsNullOrEmpty() ? null : ico.Trim();
                workFlowButton.Note   = note.IsNullOrEmpty() ? null : note.Trim();
                workFlowButton.Script = script.IsNullOrEmpty() ? null : script;
                workFlowButton.Title  = title.Trim();

                if (isAdd)
                {
                    bworkFlowButtons.Add(workFlowButton);
                    RoadFlow.Platform.Log.Add("添加了流程按钮", workFlowButton.Serialize(), RoadFlow.Platform.Log.Types.流程相关);
                }
                else
                {
                    bworkFlowButtons.Update(workFlowButton);
                    RoadFlow.Platform.Log.Add("修改了流程按钮", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, workFlowButton.Serialize());
                }
                bworkFlowButtons.ClearCache();
                ViewBag.Script = "new RoadUI.Window().reloadOpener();alert('保存成功!');new RoadUI.Window().close();";
            }
            return(View(workFlowButton == null ? new RoadFlow.Data.Model.WorkFlowButtons() : workFlowButton));
        }
        public string Delete()
        {
            RoadFlow.Platform.WorkFlowButtons workFlowButtons1 = new RoadFlow.Platform.WorkFlowButtons();
            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.WorkFlowButtons workFlowButtons2 = workFlowButtons1.Get(test, false);
                    if (workFlowButtons2 != null)
                    {
                        workFlowButtons1.Delete(test);
                        RoadFlow.Platform.Log.Add("删除了流程按钮", workFlowButtons2.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null);
                    }
                }
            }
            workFlowButtons1.ClearCache();
            return("删除成功!");
        }
        public ActionResult Edit(FormCollection collection)
        {
            RoadFlow.Platform.WorkFlowButtons   workFlowButtons = new RoadFlow.Platform.WorkFlowButtons();
            RoadFlow.Data.Model.WorkFlowButtons model           = (RoadFlow.Data.Model.WorkFlowButtons)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;
            Guid   test;

            if (str1.IsGuid(out test))
            {
                model = workFlowButtons.Get(test, false);
            }
            string oldXML = model.Serialize();

            if (collection != null)
            {
                string str2 = this.Request.Form["Title"];
                string str3 = this.Request.Form["Ico"];
                string str4 = this.Request.Form["Script"];
                string str5 = this.Request.Form["Note"];
                string str6 = this.Request.Form["Sort"];
                int    num  = !str1.IsGuid() ? 1 : 0;
                if (model == null)
                {
                    model      = new RoadFlow.Data.Model.WorkFlowButtons();
                    model.ID   = Guid.NewGuid();
                    model.Sort = workFlowButtons.GetMaxSort();
                }
                model.Ico    = str3.IsNullOrEmpty() ? (string)null : str3.Trim();
                model.Note   = str5.IsNullOrEmpty() ? (string)null : str5.Trim();
                model.Script = str4.IsNullOrEmpty() ? (string)null : str4;
                model.Title  = str2.Trim();
                model.Sort   = !str6.IsInt() ? workFlowButtons.GetMaxSort() : str6.ToInt();
                if (num != 0)
                {
                    workFlowButtons.Add(model);
                    RoadFlow.Platform.Log.Add("添加了流程按钮", model.Serialize(), RoadFlow.Platform.Log.Types.流程相关, "", "", (RoadFlow.Data.Model.Users)null);
                }
                else
                {
                    workFlowButtons.Update(model);
                    RoadFlow.Platform.Log.Add("修改了流程按钮", "", RoadFlow.Platform.Log.Types.流程相关, oldXML, model.Serialize(), (RoadFlow.Data.Model.Users)null);
                }
                workFlowButtons.ClearCache();
                // ISSUE: reference to a compiler-generated field
                if (WorkFlowButtonsController.\u003C\u003Eo__3.\u003C\u003Ep__0 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    WorkFlowButtonsController.\u003C\u003Eo__3.\u003C\u003Ep__0 = CallSite <Func <CallSite, object, string, object> > .Create(Binder.SetMember(CSharpBinderFlags.None, "Script", typeof(WorkFlowButtonsController), (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 = WorkFlowButtonsController.\u003C\u003Eo__3.\u003C\u003Ep__0.Target((CallSite)WorkFlowButtonsController.\u003C\u003Eo__3.\u003C\u003Ep__0, this.ViewBag, "new RoadUI.Window().reloadOpener();alert('保存成功!');new RoadUI.Window().close();");
            }
            if (model == null)
            {
                model      = new RoadFlow.Data.Model.WorkFlowButtons();
                model.Sort = workFlowButtons.GetMaxSort();
            }
            return((ActionResult)this.View((object)model));
        }