Esempio n. 1
0
        private ActionResult query(string title1, string address)
        {
            string pager;
            string appid  = Request.QueryString["appid"];
            string tabid  = Request.QueryString["tabid"];
            string typeid = Request.QueryString["typeid"];

            RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary();
            RoadFlow.Platform.AppLibrary bapp  = new RoadFlow.Platform.AppLibrary();
            string typeidstring = typeid.IsGuid() ? bapp.GetAllChildsIDString(typeid.ToGuid()) : "";
            string query        = string.Format("&appid={0}&tabid={1}&title1={2}&typeid={3}&address={4}",
                                                Request.QueryString["appid"],
                                                Request.QueryString["tabid"],
                                                title1.UrlEncode(), typeid, address.UrlEncode()
                                                );
            string query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]);
            List <RoadFlow.Data.Model.AppLibrary> appList = bapp.GetPagerData(out pager, query, title1, typeidstring, address);

            ViewBag.Pager   = pager;
            ViewBag.AppID   = appid;
            ViewBag.TabID   = tabid;
            ViewBag.TypeID  = typeid;
            ViewBag.Title1  = title1;
            ViewBag.Address = address;
            ViewBag.Query1  = query1;
            return(View(appList));
        }
        public string Query()
        {
            string text  = base.Request.Form["Title"];
            string text2 = base.Request.Form["Address"];
            string text3 = base.Request.Form["typeid"];
            string text4 = base.Request.Form["sidx"];
            string text5 = base.Request.Form["sord"];

            RoadFlow.Platform.Dictionary dictionary = new RoadFlow.Platform.Dictionary();
            RoadFlow.Platform.AppLibrary appLibrary = new RoadFlow.Platform.AppLibrary();
            string type       = MyExtensions.IsGuid(text3) ? appLibrary.GetAllChildsIDString(MyExtensions.ToGuid(text3)) : "";
            int    pageSize   = Tools.GetPageSize();
            int    pageNumber = Tools.GetPageNumber();
            string order      = (MyExtensions.IsNullOrEmpty(text4) ? "Title" : text4) + " " + (MyExtensions.IsNullOrEmpty(text5) ? "asc" : text5);
            long   count;
            List <RoadFlow.Data.Model.AppLibrary> pagerData = appLibrary.GetPagerData(out count, pageSize, pageNumber, MyExtensions.Trim1(text), type, MyExtensions.Trim1(text2), order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.AppLibrary item in pagerData)
            {
                string empty = string.Empty;
                empty = ((!MyExtensions.IsFontIco(item.Ico)) ? ("<img src=\"" + MyExtensions.Trim1(item.Ico) + "\" style=\"vertical-align:middle;\" />") : ("<i class=\"fa " + MyExtensions.Trim1(item.Ico) + "\" style=\"font-size:14px;vertical-align:middle;" + (MyExtensions.IsNullOrEmpty(item.Color) ? "" : ("color:" + item.Color + ";")) + "\"></i>"));
                JsonData jsonData2 = new JsonData();
                jsonData2["id"]        = item.ID.ToString();
                jsonData2["Title"]     = empty + "<span style=\"vertical-align:middle;margin-left:4px;\">" + item.Title + "</span>";
                jsonData2["Address"]   = item.Address;
                jsonData2["TypeTitle"] = dictionary.GetTitle(item.Type);
                jsonData2["Opation"]   = "<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"edit('" + item.ID.ToString() + "');return false;\" style=\"margin-right:6px;\">编辑</a><a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"editsubpage('" + item.ID.ToString() + "');return false;\">子页面</a>";
                jsonData.Add(jsonData2);
            }
            return("{\"userdata\":{\"total\":" + count + ",\"pagesize\":" + pageSize + ",\"pagenumber\":" + pageNumber + "},\"rows\":" + jsonData.ToJson() + "}");
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string pager;
            string appid   = Request.QueryString["appid"];
            string tabid   = Request.QueryString["tabid"];
            string typeid  = Request.QueryString["typeid"];
            string title1  = Request.QueryString["title1"];
            string address = Request.QueryString["address"];

            RoadFlow.Platform.AppLibrary bapp = new RoadFlow.Platform.AppLibrary();
            if (IsPostBack)
            {
                title1  = Request.Form["Title1"];
                address = Request.Form["Address"];
                //删除
                if (!Request.Form["Button1"].IsNullOrEmpty())
                {
                    string deleteID = Request.Form["checkbox_app"];
                    System.Text.StringBuilder delxml = new System.Text.StringBuilder();
                    foreach (string id in deleteID.Split(','))
                    {
                        Guid gid;
                        if (id.IsGuid(out gid))
                        {
                            var app = bapp.Get(gid);
                            if (app != null)
                            {
                                delxml.Append(app.Serialize());
                                bapp.Delete(gid);
                            }
                        }
                    }
                    RoadFlow.Platform.Log.Add("删除了一批应用程序库", delxml.ToString(), RoadFlow.Platform.Log.Types.角色应用);
                }
            }

            RoadFlow.Platform.Dictionary bdict = new RoadFlow.Platform.Dictionary();

            string typeidstring = typeid.IsGuid() ? bapp.GetAllChildsIDString(typeid.ToGuid()) : "";

            Query = string.Format("&appid={0}&tabid={1}&title1={2}&typeid={3}&address={4}",
                                  Request.QueryString["appid"],
                                  Request.QueryString["tabid"],
                                  title1.UrlEncode(), typeid, address.UrlEncode()
                                  );
            Query1 = string.Format("{0}&pagesize={1}&pagenumber={2}", Query, Request.QueryString["pagesize"], Request.QueryString["pagenumber"]);

            AppList         = bapp.GetPagerData(out pager, Query, title1, typeidstring, address);
            this.Pager.Text = pager;
        }
Esempio n. 4
0
        public string Query()
        {
            string str1 = this.Request.Form["Title"];
            string str2 = this.Request.Form["Address"];
            string str3 = this.Request.Form["typeid"];
            string str4 = this.Request.Form["sidx"];
            string str5 = this.Request.Form["sord"];

            RoadFlow.Platform.Dictionary dictionary  = new RoadFlow.Platform.Dictionary();
            RoadFlow.Platform.AppLibrary appLibrary1 = new RoadFlow.Platform.AppLibrary();
            string type       = str3.IsGuid() ? appLibrary1.GetAllChildsIDString(str3.ToGuid(), true) : "";
            int    pageSize   = Tools.GetPageSize();
            int    pageNumber = Tools.GetPageNumber();
            string order      = (str4.IsNullOrEmpty() ? "Title" : str4) + " " + (str5.IsNullOrEmpty() ? "asc" : str5);
            long   count;
            List <RoadFlow.Data.Model.AppLibrary> pagerData = appLibrary1.GetPagerData(out count, pageSize, pageNumber, str1.Trim1(), type, str2.Trim1(), order);
            JsonData jsonData = new JsonData();

            foreach (RoadFlow.Data.Model.AppLibrary appLibrary2 in pagerData)
            {
                string empty = string.Empty;
                string str6;
                if (appLibrary2.Ico.IsFontIco())
                {
                    str6 = "<i class=\"fa " + appLibrary2.Ico.Trim1() + "\" style=\"font-size:14px;vertical-align:middle;" + (appLibrary2.Color.IsNullOrEmpty() ? "" : "color:" + appLibrary2.Color + ";") + "\"></i>";
                }
                else
                {
                    str6 = "<img src=\"" + appLibrary2.Ico.Trim1() + "\" style=\"vertical-align:middle;\" />";
                }
                jsonData.Add((object)new JsonData()
                {
                    ["id"]        = (JsonData)appLibrary2.ID.ToString(),
                    ["Title"]     = (JsonData)(str6 + "<span style=\"vertical-align:middle;margin-left:4px;\">" + appLibrary2.Title + "</span>"),
                    ["Address"]   = (JsonData)appLibrary2.Address,
                    ["TypeTitle"] = (JsonData)dictionary.GetTitle(appLibrary2.Type),
                    ["Opation"]   = (JsonData)("<a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"edit('" + appLibrary2.ID.ToString() + "');return false;\" style=\"margin-right:6px;\">编辑</a><a class=\"editlink\" href=\"javascript:void(0);\" onclick=\"editsubpage('" + appLibrary2.ID.ToString() + "');return false;\">子页面</a>")
                });
            }
            return("{\"userdata\":{\"total\":" + (object)count + ",\"pagesize\":" + (object)pageSize + ",\"pagenumber\":" + (object)pageNumber + "},\"rows\":" + jsonData.ToJson(true) + "}");
        }