예제 #1
0
        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"));
        }
예제 #2
0
        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"));
        }
예제 #3
0
        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"));
        }