//Detalles public ActionResult Details(int?id) { Logica.BL.Products products = new Logica.BL.Products(); var product = products.GetProducts().Where(x => x.Id == id).FirstOrDefault(); var productsDetailsViewModel = new Logica.Models.ViewModels.ProductsDetailsViewModel { Id = product.Id, Name = product.Name, Guid = product.Guid, Extension = product.Extension, CategoryId = product.CategoryId, Price = product.Price, ShippingCost = product.ShippingCost, Warranty = product.Warranty, Description = product.Description, Quantity = product.Quantity, StateId = product.StateId, CustomerId = product.CustomerId }; //Variable de Sesion: Session["product"] = productsDetailsViewModel; return(View(productsDetailsViewModel)); }
// GET: Products public async Task <ActionResult> Index() { ApplicationUser user = await UserManager.FindByNameAsync(User.Identity.Name); Logica.BL.Products products = new Logica.BL.Products(); var listProducts = (from q in products.GetProducts() select new Logica.Models.ViewModels.ProductsIndexViewModel { Id = q.Id, Name = q.Name, Guid = q.Guid, Extension = q.Extension, CategoryId = q.CategoryId, Price = q.Price, ShippingCost = q.ShippingCost, Warranty = q.Warranty, Description = q.Description, Quantity = q.Quantity, StateId = q.StateId, CustomerId = q.CustomerId }).ToList(); return(View(listProducts)); }
public ActionResult Clothes() { Logica.BL.Products videoJuegos = new Logica.BL.Products(); var listRopa = (from q in videoJuegos.GetProducts() select new Logica.Models.ViewModels.ProductsIndexViewModel { Id = q.Id, Name = q.Name, Guid = q.Guid, Extension = q.Extension, CategoryId = q.CategoryId, Price = q.Price, ShippingCost = q.ShippingCost, Warranty = q.Warranty, Description = q.Description, Quantity = q.Quantity, StateId = q.StateId, CustomerId = q.CustomerId }).ToList(); return(View(listRopa)); }
//Index para Categorias. public ActionResult IndexCategories(int id) { Logica.BL.Products products = new Logica.BL.Products(); var listProducts = (from q in products.GetProducts() where q.CategoryId == id select new Logica.Models.ViewModels.ProductsIndexViewModel { Id = q.Id, Name = q.Name, Guid = q.Guid, Extension = q.Extension, CategoryId = q.CategoryId, Price = q.Price, ShippingCost = q.ShippingCost, Warranty = q.Warranty, Description = q.Description, Quantity = q.Quantity, StateId = q.StateId, CustomerId = q.CustomerId }).ToList(); return(View(listProducts)); }