Esempio n. 1
0
        public ActionResult Data_Admin_Menu()
        {
            this.Response.ContentType = "text/plain";

            // this.Response.ContentType = "text/plain";
            // this.Response.ContentType = "text/plain";
            string page = this.Request.QueryString["page"];
            string rows = this.Request.QueryString["rows"];
            int    _page = 0, _rows = 0;

            int.TryParse(page, out _page);
            int.TryParse(rows, out _rows);
            long TatalPage = 0;

            if (_page == 0)
            {
                _page = 1;
            }
            if (_rows == 0)
            {
                _rows = 130;
            }

            BLL.Admin_Menu dal = new BLL.Admin_Menu();

            string[] keys = this.Request.Form.AllKeys;

            List <NModel.Admin_Menu> _menu = null;

            if (_page > 0)
            {
                // TatalPage = dal.GetListTotal();
                _menu = dal.GetPagerList(_page, _rows);
            }
            else
            {
                _menu = dal.GetList();
            }

            StringBuilder sbStr = new StringBuilder();

            Tool.NJson <NModel.Admin_Menu> jstr = new Tool.NJson <NModel.Admin_Menu>();

            sbStr.Append(jstr.JsonNoLevel(SetRtMenu, SetProcessResult, _menu));

            NModel.PageData <NModel.Admin_Menu> outModel = new NModel.PageData <NModel.Admin_Menu>();
            outModel.TotalPage = TatalPage;
            // outModel.OutData = inModel;

            outModel.OutStr = sbStr.ToString();

            dal.Close();

            return(View(outModel));
        }
Esempio n. 2
0
        public ActionResult Data_Left_Admin_Menu()
        {
            this.Response.ContentType = "text/plain";

            // this.Response.ContentType = "text/plain";
            // this.Response.ContentType = "text/plain";
            BLL.Admin_Menu           dal   = new BLL.Admin_Menu();
            List <NModel.Admin_Menu> _menu = null;

            try
            {
                NModel.Admin_User mdl   = this.Session[NModel.EnObject.CurrentLoginSessionName] as NModel.Admin_User;
                string[]          arrid = (mdl.Role_Menu + "").Split(',');

                int[] lg = Tool.NTool.ArrayToAll <int, string>(arrid);

                string[] keys = this.Request.Form.AllKeys;

                _menu = dal.GetIDList(lg);
            }
            catch (Exception ex)
            {
            }

            StringBuilder sbStr = new StringBuilder();

            Tool.NJson <NModel.Admin_Menu> jstr = new Tool.NJson <NModel.Admin_Menu>();

            sbStr.Append(jstr.JsonNoLevel(SetRtMenu, SetProcessResult, _menu));

            NModel.PageData <NModel.Admin_Menu> outModel = new NModel.PageData <NModel.Admin_Menu>();
            outModel.TotalPage = 1;
            // outModel.OutData = inModel;

            outModel.OutStr = sbStr.ToString();

            dal.Close();

            return(View(outModel));
        }