Ejemplo n.º 1
0
        public ActionResult Article(int id)
        {
            int count    = 0;
            var cat_Body = new Cat_Body();

            cat_Body.cat_body_id = id;
            var data   = cm.SelectAll(cat_Body, 1, 1, ref count, "cat_body_id", false)[0];
            var result = new LappResponse <Cat_Body>();

            result.Data      = data;
            result.Code      = cm.Status == "1" ? Code.Success : Code.Failure;
            ViewBag.PageData = JsonConvert.SerializeObject(result);

            List <Cat_Body> rList = new List <Cat_Body>();
            var             list  = cm.SelectAll(new Cat_Body()
            {
                cat_body_keyword = data.cat_body_keyword
            }, 1, 1000, ref count, "cat_body_id", false);
            List <int> raList = GenerateRandom(list.Count, 15);

            raList.ForEach(x =>
            {
                rList.Add(list[x]);
            });

            ViewBag.ListData = JsonConvert.SerializeObject(rList);

            return(View());
        }
Ejemplo n.º 2
0
        public LappResponse <User> F5(User user)
        {
            var rm = new LappResponse <User>()
            {
                Data = user
            };

            return(rm);
        }
Ejemplo n.º 3
0
        public LappResponse <List <Cat_Body> > GetListPage(Cat_Body cat_Body)
        {
            int count  = 0;
            var data   = cm.SelectAll(cat_Body, cat_Body.PageIndex, cat_Body.PageSize, ref count, "cat_body_id", false);
            var result = new LappResponse <List <Cat_Body> >();

            result.Data  = data;
            result.Count = count;
            result.Code  = cm.Status == "1" ? Code.Success : Code.Failure;
            result.Page  = new Pager().GetJumperForAjax(cat_Body.PageIndex, cat_Body.PageSize, count, "ArticleList.PageSelect({0})");

            return(result);
        }
Ejemplo n.º 4
0
        public LappResponse <List <Cat_Body> > GetListByCat_Id(Cat_Body cat_Body)
        {
            int count = 0;
            var data  = cm.SelectAll(new Cat_Body()
            {
                cat_id = Convert.ToInt32(cat_Body.cat_id)
            }, 1, 5, ref count, "cat_body_id", false);
            var result = new LappResponse <List <Cat_Body> >();

            result.Data  = data;
            result.Count = count;
            result.Code  = cm.Status == "1" ? Code.Success : Code.Failure;

            return(result);
        }
Ejemplo n.º 5
0
        public ActionResult List(string id)
        {
            string title = "";

            string[] strs = id.Split('-');

            string pid = strs.Length > 0 ? strs[0] : "0";

            string newId = strs.Length > 0 ? strs[1] : "0";

            switch (pid)
            {
            case "355":
                title = "校园动态";
                break;

            case "x":
                pid   = "660,849";
                title = "通知公告";
                break;

            case "y":
                pid   = "369,557,699";
                title = "作品园地";
                break;

            case "560":
                title = "基层党务";
                break;

            case "582":
                title = "基层党务";
                break;

            case "563":
                title = "基层党务";
                break;

            case "824":
                title = "行为规范";
                break;

            case "825":
                title = "行为规范";
                break;

            case "826":
                title = "行为规范";
                break;

            case "827":
                title = "行为规范";
                break;

            case "853":
                title = "文明在线";
                break;

            case "854":
                title = "文明在线";
                break;

            case "668":
                title = "学校信息公开";
                break;

            case "691":
                title = "学校信息公开";
                break;

            case "692":
                title = "学校信息公开";
                break;

            case "704":
                title = "学校信息公开";
                break;
            }

            int count = 0;

            var menus = cmain.SelectAll(new Cat_Main()
            {
                cat_parent_ids = pid
            }, 1, 100, ref count, "cat_id", false);

            ViewBag.MenuList = JsonConvert.SerializeObject(menus);
            if (pid == "660,849")
            {
                pid = "x";
            }
            else if (pid == "369,557,699")
            {
                pid = "y";
            }


            var cat_Body = new Cat_Body();

            cat_Body.cat_id    = Convert.ToInt32(newId);
            cat_Body.PageIndex = 1;
            cat_Body.PageSize  = 30;
            var data   = cm.SelectAll(cat_Body, cat_Body.PageIndex, cat_Body.PageSize, ref count, "cat_body_id", false);
            var result = new LappResponse <List <Cat_Body> >();

            result.Message   = title;
            result.TitleName = menus.Where(x => x.cat_id == Convert.ToInt32(newId)).ToList().First().cat_name;
            result.ID        = pid;
            result.Data      = data;
            result.Code      = cm.Status == "1" ? Code.Success : Code.Failure;
            result.Page      = new Pager().GetJumperForAjax(cat_Body.PageIndex, cat_Body.PageSize, count, "ArticleList.PageSelect({0})");
            ViewBag.PageData = JsonConvert.SerializeObject(result);
            return(View());
        }
Ejemplo n.º 6
0
        public ActionResult List(string id)
        {
            string title = "";
            string pid   = "";

            switch (id)
            {
            case "355":
                title = "校园动态";
                pid   = id;
                break;

            case "x":
                id    = "660,849";
                title = "通知公告";
                pid   = "x";
                break;

            case "y":
                id    = "369,557,699";
                title = "作品园地";
                pid   = "y";
                break;

            case "560":
                title = "基层党务";
                pid   = id;
                break;

            case "582":
                title = "基层党务";
                pid   = id;
                break;

            case "563":
                title = "基层党务";
                pid   = id;
                break;

            case "824":
                title = "行为规范";
                pid   = id;
                break;

            case "825":
                title = "行为规范";
                pid   = id;
                break;

            case "826":
                title = "行为规范";
                pid   = id;
                break;

            case "827":
                title = "行为规范";
                pid   = id;
                break;

            case "853":
                title = "文明在线";
                pid   = id;
                break;

            case "854":
                title = "文明在线";
                pid   = id;
                break;

            case "668":
                title = "学校信息公开";
                pid   = id;
                break;

            case "691":
                title = "学校信息公开";
                pid   = id;
                break;

            case "692":
                title = "学校信息公开";
                pid   = id;
                break;

            case "704":
                title = "学校信息公开";
                pid   = id;
                break;
            }

            int count = 0;
            var data  = cm.SelectAll(new Cat_Main()
            {
                cat_parent_ids = id
            }, 1, 100, ref count, "cat_id", false);
            var result = new LappResponse <List <Cat_Main> >();

            result.Data      = data;
            result.Code      = cm.Status == "1" ? Code.Success : Code.Failure;
            result.Message   = title;
            result.ID        = pid;
            ViewBag.MenuList = JsonConvert.SerializeObject(result);

            return(View());
        }