Пример #1
0
        public ActionResult UpdateBloodBook(int id, BloodBook bb)
        {
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Index", "User"));
            }

            if (ModelState.IsValid)
            {
                bb.UserId = (int)Session["userid"];
                context.Entry(bb).State = EntityState.Modified;
                context.SaveChanges();
                return(RedirectToAction("BloodBook"));
            }
            return(View());
        }
Пример #2
0
 public void Update(TEntity entity)
 {
     context.Entry(entity).State = System.Data.Entity.EntityState.Modified;
     context.SaveChanges();
 }