Пример #1
0
        public ActionResult List()
        {
            string PageId = Request.Params["page"];
            string xml    = Dm.GetListXml("projects", PageId);

            List <Post> posts = Dm.ParseList(xml);

            Category category = Dm.ParseCategory(xml);

            category.Name = "projects";

            if (Request.HttpMethod.ToLower() == "post")
            {
                JsonMessage jm = new JsonMessage();

                if (posts.Count > 0)
                {
                    jm.Result = true;
                    jm.Object = posts;
                }
                else
                {
                    jm.Result = false;
                }

                return(Json(jm));
            }
            else
            {
                ViewData["Posts"]    = posts;
                ViewData["Category"] = category;
                return(View(Dm));
            }
        }
Пример #2
0
        //
        // GET: /Home/

        public ActionResult Index()
        {
            string      xml   = Dm.GetListXml("projects", null);
            List <Post> posts = Dm.ParseList(xml).Take(3).ToList();

            ViewData["Projects"] = posts;

            return(View(Dm));
        }