public async Task <IActionResult> Edit(int id, [Bind("PotentialTransformerId,SwitchGearID,NameoftheManufacturer,TypeAndModelNo,NominalSystemVoltage,HeightsSystemVoltage,RatedPrimaryVoltage,RatedSecondaryVoltageandTertiaryVoltage,ImpulseWithstAndVoltage,MicroSec12or50,PowerFrequencyWithstandVoltage,BurdenOrClass,MeteringWinding,ProtectionWinding")] LookUpPotentialTrans33KV lookUpPotentialTrans33KV) { if (id != lookUpPotentialTrans33KV.PotentialTransformerId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(lookUpPotentialTrans33KV); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LookUpPotentialTrans33KVExists(lookUpPotentialTrans33KV.PotentialTransformerId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["SwitchGearID"] = new SelectList(_context.TblSwitchGear, "SwitchGearID", "SwitchGearID", lookUpPotentialTrans33KV.SwitchGearID); return(View(lookUpPotentialTrans33KV)); }
public async Task <IActionResult> Create([Bind("PotentialTransformerId,SwitchGearID,NameoftheManufacturer,TypeAndModelNo,NominalSystemVoltage,HeightsSystemVoltage,RatedPrimaryVoltage,RatedSecondaryVoltageandTertiaryVoltage,ImpulseWithstAndVoltage,MicroSec12or50,PowerFrequencyWithstandVoltage,BurdenOrClass,MeteringWinding,ProtectionWinding")] LookUpPotentialTrans33KV lookUpPotentialTrans33KV) { if (ModelState.IsValid) { _context.Add(lookUpPotentialTrans33KV); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["SwitchGearID"] = new SelectList(_context.TblSwitchGear, "SwitchGearID", "SwitchGearID", lookUpPotentialTrans33KV.SwitchGearID); return(View(lookUpPotentialTrans33KV)); }