public ActionResult Details(int Id) { CatalogManager catManager = new CatalogManager(); Catalog cat = catManager.GetCatalog(Id); var Model = new Models.CatalogModels.CatalogDetails { Code = cat.Code, Description = cat.Description, Products = cat.CatalogProduct.Select(s => s.Product).ToList() }; return(View(Model)); }
public ActionResult Edit(int Id) { CatalogManager catManager = new CatalogManager(); var Catalog = catManager.GetCatalog(Id); var Model = new Models.CatalogModels.CatalogEdit { Description = Catalog.Description, Id = Catalog.Id, Code = Catalog.Code }; return(View(Model)); }
public ActionResult Association(int Id, bool?isError) { CatalogManager catManager = new CatalogManager(); ProductManager prodManager = new ProductManager(); var Catalog = catManager.GetCatalog(Id); var Products = prodManager.GetProducts(); var Model = new Models.CatalogModels.AssociationProducts { Description = Catalog.Description, IdCatalog = Catalog.Id, Code = Catalog.Code, Products = new SelectList(Products, "Id", "Description"), IsError = !isError.HasValue ? false : isError.Value }; return(View(Model)); //Catalogs = new SelectList(_Catalogs, "Id", "Description"), }