public IActionResult InsertFisk(IFormCollection fc) { Fiskar f1 = new Fiskar(); PersonMetoder pm = new PersonMetoder(); int i = 0; string error = ""; f1.Art = fc["Art"]; f1.Vikt = Convert.ToInt32(fc["Vikt"]); f1.Vatten = fc["Vatten"]; f1.Persnr = Convert.ToInt64(fc["persnr"]); f1.Betenr = Convert.ToInt32(fc["Betenr"]); i = pm.InsertFisk(f1, out error); ViewBag.error = error; ViewBag.antal = i; return(View()); }
public IActionResult UpdateFisk(IFormCollection fc, int id) { Fiskar b1 = new Fiskar(); PersonMetoder pm = new PersonMetoder(); int i = 0; string error = ""; b1.ID = Convert.ToInt32(fc["FiskID"]); b1.Art = fc["Art"]; b1.Vikt = Convert.ToInt32(fc["Vikt"]); b1.Vatten = fc["Vatten"]; i = pm.UpdateFisk(b1, id, out error); ViewBag.error = error; ViewBag.antal = i; return(View()); }