public ResultModel Get()
 {
     try
     {
         var resultQuery = _postBLL.GetAll();
         return(new ResultModel(Code.OK, resultQuery, resultQuery.Count(), "thành công"));
     }
     catch (Exception)
     {
         return(new ResultModel(Code.SVERROR, "lỗi hệ thống"));
     }
 }
Exemple #2
0
        public ActionResult List()
        {
            List <PostVM> ls = new List <PostVM>();

            foreach (Post p in postBLL.GetAll())
            {
                PostVM postVM = new PostVM();
                postVM.ID           = p.ID;
                postVM.ImageContent = p.ContentImage.Base64;
                postVM.TextContent  = p.TextContent;
                ls.Add(postVM);
            }
            return(View(ls));
        }
Exemple #3
0
 // GET: Menu
 public ActionResult LoadMenu()
 {
     if (Session["SS_Menu_Product"] == null)
     {
         Session["SS_Menu_Product"]      = productBLL.GetAll();
         Session["SS_Menu_Submenu"]      = productCategoryBLL.GetByParentID(2);
         Session["SS_Menu_PostCategory"] = postCategoryBLL.GetAll();
         Session["SS_Menu_Post"]         = postBLL.GetAll();
     }
     ViewBag.Products     = (List <Product>)Session["SS_Menu_Product"];
     ViewBag.Submenu      = (List <ProductCategory>)Session["SS_Menu_Submenu"];
     ViewBag.PostCategory = (List <PostCategory>)Session["SS_Menu_PostCategory"];
     ViewBag.Post         = (List <Post>)Session["SS_Menu_Post"];
     return(PartialView(menuBLL.GetAll()));
 }
        // GET: Admin/Post
        public ActionResult Index()
        {
            var data = postBLL.GetAll();

            return(View(data));
        }