Example #1
0
        public ActionResult ButtionsEdit(FormCollection collection)
        {
            RoadFlow.Data.Model.AppLibraryButtons appLibraryButtons  = null;
            RoadFlow.Platform.AppLibraryButtons   appLibraryButtons2 = new RoadFlow.Platform.AppLibraryButtons();
            string str = base.Request.QueryString["butid"];

            if (str.IsGuid())
            {
                appLibraryButtons = appLibraryButtons2.Get(str.ToGuid());
            }
            if (collection != null)
            {
                string str2   = base.Request.Form["Name"];
                string events = base.Request.Form["Events"];
                string ico    = base.Request.Form["Ico"];
                string note   = base.Request.Form["Note"];
                string str3   = base.Request.Form["Sort"];
                bool   flag   = false;
                string oldXML = string.Empty;
                if (appLibraryButtons == null)
                {
                    flag = true;
                    appLibraryButtons    = new RoadFlow.Data.Model.AppLibraryButtons();
                    appLibraryButtons.ID = Guid.NewGuid();
                }
                else
                {
                    oldXML = appLibraryButtons.Serialize();
                }
                appLibraryButtons.Name   = str2.Trim1();
                appLibraryButtons.Events = events;
                appLibraryButtons.Ico    = ico;
                appLibraryButtons.Note   = note;
                appLibraryButtons.Sort   = str3.ToInt();
                if (flag)
                {
                    appLibraryButtons2.Add(appLibraryButtons);
                    RoadFlow.Platform.Log.Add("添加了按钮", appLibraryButtons.Serialize(), RoadFlow.Platform.Log.Types.系统管理);
                }
                else
                {
                    appLibraryButtons2.Update(appLibraryButtons);
                    RoadFlow.Platform.Log.Add("修改了按钮", appLibraryButtons.Serialize(), RoadFlow.Platform.Log.Types.系统管理, oldXML);
                }
                base.ViewBag.Script = "alert('保存成功!');new RoadUI.Window().getOpenerWindow().query();new RoadUI.Window().close();";
            }
            string text = "&appid=" + base.Request.QueryString["appid"] + "&tabid=" + base.Request.QueryString["tabid"] + "&title=";

            base.ViewBag.Query = text;
            if (appLibraryButtons == null)
            {
                appLibraryButtons      = new RoadFlow.Data.Model.AppLibraryButtons();
                appLibraryButtons.Sort = appLibraryButtons2.GetMaxSort();
            }
            return(View(appLibraryButtons));
        }
Example #2
0
 public string ButtionsDelete()
 {
     RoadFlow.Platform.AppLibraryButtons appLibraryButtons = new RoadFlow.Platform.AppLibraryButtons();
     string[] array = (base.Request.Form["ids"] ?? "").Split(',');
     foreach (string str in array)
     {
         RoadFlow.Data.Model.AppLibraryButtons appLibraryButtons2 = appLibraryButtons.Get(str.ToGuid());
         if (appLibraryButtons2 != null)
         {
             appLibraryButtons.Delete(appLibraryButtons2.ID);
             RoadFlow.Platform.Log.Add("删除了按钮", appLibraryButtons2.Serialize(), RoadFlow.Platform.Log.Types.系统管理);
         }
     }
     return("删除成功!");
 }