Ejemplo n.º 1
0
        public async Task <IActionResult> CreateType(ProductTypeCreateInputModel productTypeCreateInputModel)
        {
            ProductTypeServiceModel productTypeServiceModel = mapper.Map <ProductTypeServiceModel>(productTypeCreateInputModel);

            await this.productService.CreateProductType(productTypeServiceModel);

            return(this.Redirect("/"));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> CreateType(ProductTypeCreateInputModel model)
        {
            ProductTypeServiceModel productType = new ProductTypeServiceModel
            {
                Name = model.Name
            };

            await this.productService.CreateProductType(productType);

            return(this.Redirect("/"));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create(ProductTypeCreateInputModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(model));
            }

            await this.productTypeService.CreateAsync(model.Name);

            return(this.RedirectToAction(nameof(this.Index)));
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> CreateType(ProductTypeCreateInputModel productTypeCreateInputModel)
        {
            if (!ModelState.IsValid)
            {
                return(this.View(productTypeCreateInputModel));
            }

            //for one it is not worth it?
            ProductTypeServiceModel productTypeServiceModel = new ProductTypeServiceModel
            {
                Name = productTypeCreateInputModel.Name
            };

            await this.productService.CreateProductType(productTypeServiceModel);

            return(this.Redirect("/"));
        }