Ejemplo n.º 1
0
 public ActionResult sletTilmelding(TilmedlingTb SletTilmelding)
 {
     SletTilmelding = db.TilmedlingTbs.Find(SletTilmelding.Id);
     if (SletTilmelding == null)
     {
         return(RedirectToAction("Tilmeldinger"));
     }
     db.TilmedlingTbs.Remove(SletTilmelding);
     db.SaveChanges();
     return(RedirectToAction("Tilmeldinger"));
 }
Ejemplo n.º 2
0
        public ActionResult sletTilmelding(int?Id)
        {
            if (Id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TilmedlingTb SletTilmeldinge = db.TilmedlingTbs.Find(Id);

            if (SletTilmeldinge == null)
            {
                return(HttpNotFound());
            }

            return(View(SletTilmeldinge));
        }
Ejemplo n.º 3
0
        public ActionResult VisEvent(TilmedlingTb tilmedling)
        {
            if (ModelState.IsValid)
            {
                //tilmedling.MailName = db.TilmedlingTbs.FirstOrDefault();
                db.TilmedlingTbs.Add(tilmedling);

                db.SaveChanges();

                //tilmedling.MyEvent.PladserAntal = tilmedling.MyEvent.PladserAntal - 1;
            }
            //EventsTb paldsantal = db.EventsTbs.Where(i => i.Id == tilmedling.Fk_EventId).FirstOrDefault();
            //paldsantal.PladserAntal = paldsantal.PladserAntal - 1;
            //db.EventsTbs.AddOrUpdate(paldsantal);
            //db.SaveChanges();


            return(RedirectToAction("Events", "Home"));
        }