Esempio n. 1
0
 // GET: Reservation
 public ActionResult Index()
 {
     if (UserSession.CurrentUser != null && (UserSession.CurrentUser.admin == true || UserSession.CurrentUser.super_admin == true))
     {
         return(View(RentRoomMemberManager.GetList()));
     }
     else
     {
         return(RedirectToAction("Create", "Login"));
     }
 }
Esempio n. 2
0
 public ActionResult Create(int id, RentRoomMemberEntity rentRoomMember)
 {
     try
     {
         RentRoomMemberManager.Add(id, UserSession.CurrentUser.id, rentRoomMember.firstdate, rentRoomMember.lastdate, rentRoomMember.adult, rentRoomMember.child, rentRoomMember.price, rentRoomMember.assurance);
         return(RedirectToAction("Index", "Home"));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 3
0
 public ActionResult IndexValidate(int id)
 {
     if (UserSession.CurrentUser != null && id == UserSession.CurrentUser.id)
     {
         ViewModelManager viewModel = new ViewModelManager();
         viewModel.RentRoomMemberValidates = RentRoomMemberManager.GetListValidateById(id);
         viewModel.Rooms  = RoomManager.GetList();
         viewModel.Member = UserSession.CurrentUser;
         return(View(viewModel));
     }
     else
     {
         return(RedirectToAction("Create", "Login"));
     }
 }
Esempio n. 4
0
 public ActionResult IndexNotValidate(int id)
 {
     if (UserSession.CurrentUser != null && id == UserSession.CurrentUser.id)
     {
         ViewModelManager viewModel = new ViewModelManager();
         viewModel.RentRoomMemberNotValidates = RentRoomMemberManager.GetListNotValidateById(id);
         viewModel.Rooms  = RoomManager.GetList();
         viewModel.Member = UserSession.CurrentUser;
         if (viewModel.RentRoomMemberNotValidates.Count() > 0)
         {
             foreach (RoomEntity item in viewModel.Rooms)
             {
                 viewModel.TotalPrice += item.price;
             }
         }
         return(View(viewModel));
     }
     else
     {
         return(RedirectToAction("Create", "Login"));
     }
 }