// 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")); } }
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()); } }
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")); } }
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")); } }