Example #1
0
        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));
        }
Example #2
0
        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));
        }
Example #3
0
        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"),
        }