public ActionResult accessDel(int Id) { ViewPortfel model = new ViewPortfel(); Portfel portfel = db.Portfels.First(p => p.Id == Id); db.Entry(portfel).State = EntityState.Deleted; db.SaveChanges(); return(RedirectToAction("PortfelControl")); }
public ActionResult accessOk(int Id) { ViewPortfel model = new ViewPortfel(); Portfel portfel = db.Portfels.First(p => p.Id == Id); portfel.OpenAccess = true; db.Entry(portfel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("PortfelControl")); }
public ActionResult OpenArt(int id) { ViewPortfel model = new ViewPortfel(); Portfel portfel = new Portfel() { ArticleId = id, OpenAccess = false, UserId = User.Identity.GetUserId(), Otkaz = false, DateQuest = DateTime.Now }; db.Entry(portfel).State = EntityState.Added; db.SaveChanges(); return(RedirectToAction("PortfelControl")); }