public ActionResult Delete(int Id) { using (var db = new alkemyChallengeEntities()) { var user = db.userAmounts.Find(Id); user.isIDstate = 3; db.Entry(user).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(Content("1")); }
public ActionResult Edit(EditAMBViewModels model) { if (!ModelState.IsValid) { return(View(model)); } using (var db = new alkemyChallengeEntities()) { var user = db.userAmounts.Find(model.concept); user.amount = model.amount; user.date = model.date; user.type = model.type; db.Entry(user).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(Redirect(Url.Content("~/AMB/"))); }