public IActionResult Delete(long id, ReservationViewModel rvm)
        {
            activeUser = userBll.GetUserById((long)HttpContext.Session.GetInt32("userId"));
            Reservation res = reservationBll.GetReservationById(id);

            if (res.UserId == activeUser.UserId || activeUser.Administrator > 0)
            {
                reservationBll.DeleteReservation(id);

                rvm.UserId   = res.UserId;
                rvm.User     = userBll.GetUserById(res.UserId);
                rvm.UserCode = rvm.User.Login;
            }

            rvm.ActiveUser          = activeUser;
            rvm.Dictionary          = new Dictionary(HttpContext.Session.GetInt32("language"));
            ViewData["sessionData"] = new int?[] { HttpContext.Session.GetInt32("admin"), HttpContext.Session.GetInt32("language") };
            return(RedirectToAction("Index", rvm));
        }
Exemple #2
0
 public void Delete(long id)
 {
     reservationBll.DeleteReservation(id);
     //reservationProcessor.Delete(id);
 }
Exemple #3
0
 public void Delete(long id)
 {
     reservationBll.DeleteReservation(id);
 }