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