Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. public ActionResult Edit([Bind(Include = "ID,imię,nazwisko,data_urodzenia,email,wydane_pieniądze")] Klienci klienci)
  2.         {
  3.             if (ModelState.IsValid)
  4.             {
  5.                 db.Entry(klienci).State = EntityState.Modified;
  6.                 try
  7.                 {
  8.                     db.Modyfikacja(this.modyfikacja_glob, this.id_glob);
  9.                     db.SaveChanges();
  10.                     return RedirectToAction("Index");
  11.                 }
  12.                 catch (Exception e)
  13.                 {
  14.                     ViewBag.Exception2 = e.InnerException.InnerException.Message;
  15.                     ModelState.Clear();
  16.                     db = new SklepEntities();
  17.                     Klienci klienci_new = db.Kliencis.Find(klienci.ID);
  18.                     ViewBag.Exception = "Baza Danuch zwróciła wyjątek";
  19.                     return View(klienci_new);
  20.                 }
  21.             }
  22.             return View(klienci);
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement