Example #1
0
        public JsonResult DeleteRezervasyonRecord(int rezervasyonID)
        {
            bool result             = false;
            RezervasyonActivite usr = db.RezervasyonActivites.SingleOrDefault(x => x.rezervasyonID == rezervasyonID);

            if (usr != null)
            {
                //db.Bildirims.Remove(usr);
                db.RezervasyonActivites.Remove(usr);
                db.SaveChanges();
                result = true;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Example #2
0
 public ActionResult Create(RezervasyonActivite activite)
 {
     if (ModelState.IsValid)
     {
         try
         {
             db.RezervasyonActivites.Add(activite);
             activite.active   = false;
             activite.createAt = DateTime.Now;
             db.SaveChanges();
             //return RedirectToAction("Create", "RezervasyonActivite");
             return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK));
         }
         catch (Exception)
         {
             return(new HttpStatusCodeResult(System.Net.HttpStatusCode.InternalServerError));
         }
     }
     ViewBag.activiteID = new SelectList(db.Activites, "activiteID", "activiteAdi");
     return(View(activite));
 }