public async Task <IActionResult> Edit(int id, [Bind("SwitchPositionId,ElectricalAndMechanicalInterlock,CurrentTransformer,RatedVoltage,AccuracyClassMetering,AccuracyClassOCEFProtection,RatedCurrentRatio,Burden,RatedFrequency")] LookUpSwitchPosition lookUpSwitchPosition) { if (id != lookUpSwitchPosition.SwitchPositionId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(lookUpSwitchPosition); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LookUpSwitchPositionExists(lookUpSwitchPosition.SwitchPositionId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(lookUpSwitchPosition)); }
public async Task <IActionResult> Create([Bind("SwitchPositionId,ElectricalAndMechanicalInterlock,CurrentTransformer,RatedVoltage,AccuracyClassMetering,AccuracyClassOCEFProtection,RatedCurrentRatio,Burden,RatedFrequency")] LookUpSwitchPosition lookUpSwitchPosition) { if (ModelState.IsValid) { _context.Add(lookUpSwitchPosition); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(lookUpSwitchPosition)); }