Example #1
0
        public string ButtonsQuery()
        {
            string title      = base.Request.Form["Title"];
            string text       = base.Request.Form["sidx"];
            string text2      = base.Request.Form["sord"];
            int    pageSize   = Tools.GetPageSize();
            int    pageNumber = Tools.GetPageNumber();
            string order      = (text.IsNullOrEmpty() ? "Type" : text) + " " + (text2.IsNullOrEmpty() ? "asc" : text2);
            long   count;
            List <RoadFlow.Data.Model.AppLibraryButtons> pagerData = new RoadFlow.Platform.AppLibraryButtons().GetPagerData(out count, pageSize, pageNumber, title, order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.AppLibraryButtons item in pagerData)
            {
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]      = item.ID.ToString();
                jsonData2["Name"]    = item.Name;
                jsonData2["Ico"]     = (item.Ico.IsNullOrEmpty() ? "" : (item.Ico.IsFontIco() ? ("<i class='fa " + item.Ico + "' style='font-size:14px;vertical-align:middle;margin-right:3px;'></i>") : ("<img src=\"" + base.Url.Content("~" + item.Ico) + "\" style=\"vertical-align:middle;\" />")));
                jsonData2["Events"]  = item.Events;
                jsonData2["Note"]    = item.Note;
                jsonData2["Sort"]    = item.Sort;
                jsonData2["Opation"] = "<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"add('" + item.ID + "');return false;\">编辑</a>";
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Example #2
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 #3
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("删除成功!");
 }