Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("OperatingVoltageId,OperatingVoltageName")] LookUpOperatingVoltage lookUpOperatingVoltage)
        {
            if (id != lookUpOperatingVoltage.OperatingVoltageId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lookUpOperatingVoltage);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LookUpOperatingVoltageExists(lookUpOperatingVoltage.OperatingVoltageId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(lookUpOperatingVoltage));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("OperatingVoltageId,OperatingVoltageName")] LookUpOperatingVoltage lookUpOperatingVoltage)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lookUpOperatingVoltage);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(lookUpOperatingVoltage));
        }