Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Admin_Id,Type,DateCreate,DateModify")] ProductType productType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Admin_Id"] = new SelectList(_context.Admins, "Id", "Email", productType.Admin_Id);
            return(View(productType));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Admin_Id,Name,DateCreate,DateModify")] ProductBrand productBrand)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productBrand);
                await _context.SaveChangesAsync();

                return(RedirectToAction("ProductBrandsOverview", "Admin"));
            }
            ViewData["Admin_Id"] = new SelectList(_context.Admins, "Id", "Email", productBrand.Admin_Id);
            return(View(productBrand));
        }