public ActionResult Edit([Bind(Include = "idperson,firstname,lastname,gamertag,currencybalance,isactive,email,password,salt,userrole")] tblperson tblperson) { if (ModelState.IsValid) { db.Entry(tblperson).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblperson)); }
/// <summary> /// /// </summary> /// <param name="email"></param> /// <param name="balanceNew"></param> /// <returns></returns> public static bool BalanceUpdateByEmail(string email, int balanceNew) { var dbUser = GetPersonByEmail(email); dbUser.Currencybalance = balanceNew; try { using (var db = new ClonestoneFSEntities()) { db.Entry(dbUser).State = EntityState.Modified; db.SaveChanges(); return(true); } } catch (Exception e) { Writer.LogError(e); return(false); } }