// GET: Products/Create
        public ActionResult Create()
        {
            ProductCategoriesService service = new ProductCategoriesService();

            ViewBag.listProductCategories = service.Retrieve();
            return(View());
        }
Exemplo n.º 2
0
 public ProductsManager(ProductsService productsService,
                        ProductCategoriesService categoriesService,
                        ManufacturesService manufacturesService,
                        ProvidersService providersService) : base(productsService)
 {
     _productsService     = productsService;
     _categoriesService   = categoriesService;
     _manufacturesManager = manufacturesService;
     _providersManager    = providersService;
 }
 public ActionResult Create(ProductCategory pc)
 {
     try
     {
         ProductCategoriesService service = new ProductCategoriesService();
         service.Create(pc);
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(View());
     }
 }
 public ProductCategoriesServiceTests()
 {
     _mockMediator             = new Mock <IMediator>();
     _productCategoriesService = new ProductCategoriesService(_mockMediator.Object);
 }
 public ProductCategoriesController()
 {
     this.service = new ProductCategoriesService(new ProductCategoriesEFRepository());
 }
 public ProductCategoriesManager(ProductCategoriesService productCategoriesService)
 {
     _productCategoriesService = productCategoriesService;
 }