public ActionResult Edit([Bind(Include = "KayttajaNimi,Rooli,Etunimi,Sukunimi,Salasana,Sahkoposti")] Users users) { if (ModelState.IsValid) { db.Entry(users).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Rooli = new SelectList(db.UserRoles, "Role", "Role", users.Rooli); return(View(users)); }
public ActionResult Edit([Bind(Include = "ID,Kayttaja,OstoMyynti,Pvm,Yritys,Maara,MaaraForPortfolio,aHinta,Total,TotalForPortfolio,Valuutta,Kurssi,TotalEuros,Kulut,Grandtotal")] Transactions transactions) { if (ModelState.IsValid) { db.Entry(transactions).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Valuutta = new SelectList(db.Currency, "Currency1", "Currency1", transactions.Valuutta); ViewBag.Kayttaja = new SelectList(db.Users, "KayttajaNimi", "Rooli", transactions.Kayttaja); ViewBag.OstoMyynti = new SelectList(db.TransactionTypes, "Type", "Type", transactions.OstoMyynti); //return View(transactions); return(PartialView("_TransactionModalEdit", transactions)); }