Esempio n. 1
0
 public IActionResult Gallery(GetAllProductViewModel model)
 {
     ViewBag.TotalPage = api.TotalPage(new TotalPageProductViewModel {
         CountOnPage = model.CountOnPage
     });
     return(View(api.GetAll(model)));
 }
Esempio n. 2
0
        public IActionResult Index(GetAllProductViewModel model)
        {
            var TotalPage = api.TotalPage(new TotalPageProductViewModel {
                CountOnPage = 50
            });

            model.CountOnPage = 50;
            var GetAllProduct     = api.GetAll(model);
            var ListProductUpdate = GetAllProduct.Products.Select(c => new UpdateProductViewModel
            {
                Product = new GetProductViewModel
                {
                    Category    = c.Category,
                    Customer    = c.Customer,
                    Description = c.Description,
                    EndDate     = c.EndDate,
                    Images      = c.Images,
                    Services    = c.Services,
                    SiteName    = c.SiteName,
                    SiteUrl     = c.SiteUrl,
                    StartDate   = c.StartDate,
                    Tags        = c.Tags
                },
                ProductBefore = new FindProductViewModel
                {
                    Customer = c.Customer,
                    SiteName = c.SiteName,
                    SiteUrl  = c.SiteUrl
                }
            }).ToList();

            var NewModel = new GetAllProductForAdminViewModel
            {
                Products    = ListProductUpdate,
                CountOnPage = 50,
                CurrentPage = model.CurrentPage,
                TotalPage   = TotalPage
            };

            return(View(NewModel));
        }