Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("IdEntity,Name,TypeId,Email")] Entity entity)
        {
            if (ModelState.IsValid)
            {
                _context.Add(entity);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(entity));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("IdProduct,CommercialBrandIdBrand,Description,CostPrice,IVA")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CommercialBrandIdBrand"] = new SelectList(_context.CommerciallBrand, "IdBrand", "Name", product.CommercialBrandIdBrand);
            return(View(product));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("FirstName,SecondName,ClientType,Gender,Birthdate,EntityIdEntity")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EntityIdEntity"] = new SelectList(_context.Entity, "IdEntity", "IdEntity", client.EntityIdEntity);
            return(View(client));
        }