public IActionResult Delete(long id, string message)
        {
            ReservationFE res = new ReservationFE(flexDeskBll, reservationBll.GetReservationById(id));

            activeUser      = userBll.GetUserById((long)HttpContext.Session.GetInt32("userId"));
            res.NameCreator = activeUser.FirstName + " " + activeUser.Name;

            rvm.ReservationUser  = res;
            rvm.UserId           = res.UserId;
            rvm.User             = userBll.GetUserById(res.UserId);
            rvm.UserCode         = rvm.User.Login;
            rvm.ReservationFloor = floorBll.GetFloorById(departmentBll.GetDepartmentById(flexDeskBll.GetFlexDeskById(res.FlexDeskId).DepartmentId).FloorId);

            rvm.Dictionary = new Dictionary(HttpContext.Session.GetInt32("language"));

            if (message == "" || message == null)
            {
                message = rvm.Dictionary.Label5 + " " + rvm.Dictionary.Label19;
            }
            ViewData["Title"] = message;


            rvm.ActiveUser          = activeUser;
            ViewData["sessionData"] = new int?[] { HttpContext.Session.GetInt32("admin"), HttpContext.Session.GetInt32("language") };

            UpdateRvm(rvm);

            return(View(rvm));
        }
Ejemplo n.º 2
0
        public Reservation Get(long id)
        {
            var reservation = reservationBll.GetReservationById(id);

            reservation.FlexDesk                           = flexdeskProvider.GetById(reservation.FlexDeskId);
            reservation.FlexDesk.Department                = departmentProvider.GetById(reservation.FlexDesk.DepartmentId);
            reservation.FlexDesk.Department.Floor          = floorProvider.GetById(reservation.FlexDesk.Department.FloorId);
            reservation.FlexDesk.Department.Floor.Building = buildingProvider.GetById(reservation.FlexDesk.Department.Floor.BuildingId);
            reservation.User = userProvider.GetById(reservation.UserId);

            return(reservation);
        }