public IActionResult Index(IFormCollection data) { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?Area=Receptionists&Ctrl=Rooms&Act=Index")); } BookingDAO.Update(); List <string> StylesSelected = new List <string>(); List <string> SizesSelected = new List <string>(); foreach (var obj in data) { if (obj.Key.StartsWith("roomstyle")) { StylesSelected = obj.Value.ToList(); } else if (obj.Key.StartsWith("roomsize")) { SizesSelected = obj.Value.ToList(); } } ViewBag.StylesSelected = StylesSelected; ViewBag.SizesSelected = SizesSelected; string str = string.Join(",", StylesSelected); ViewData.Model = RoomsDAO.GetRoomsViewModel(StylesSelected, SizesSelected); return(View()); }
public IActionResult Index() { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?Area=Receptionists&Ctrl=Rooms&Act=Index")); } BookingDAO.Update(); List <string> StylesSelected = new List <string>(); List <string> SizesSelected = new List <string>(); foreach (var roomstyle in RoomStyleDAO.GetAllRoomStyle()) { StylesSelected.Add(roomstyle.RoomStyleID.ToString()); } foreach (var roomsize in RoomSizeDAO.GetAllRoomSize()) { SizesSelected.Add(roomsize.RoomSizeID.ToString()); } ViewBag.StylesSelected = StylesSelected; ViewBag.SizesSelected = SizesSelected; ViewData.Model = RoomsDAO.GetRoomsViewModel(); return(View()); }
public IActionResult Index() { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Statistics&act=Index")); } return(View()); }
public IActionResult Index() { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Staff&act=Index")); } List <Staff> list = StaffDA0.GetAllStaffs(); return(View(list)); }
public IActionResult ReportTable() { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Statistics&act=ReportTable")); } List <ReportModel> list = StatisticDA0.GetAllAmountInMonthOfYear(); return(View(list)); }
public IActionResult Index() { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Guests&act=Index")); } List <Guest> list = GuestDAO.GetAllGuests(); return(View(list)); }
public IActionResult Checkout(int id, bool isEdit = true) { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Activities&act=Checkout")); } ViewBag.isEdit = isEdit; BookingModel model = BookingDAO.GetBookingModel(id); return(View(model)); }
public IActionResult Index() { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Activities&act=Index")); } BookingDAO.Update(); ActivitiesViewModel model = ActivitiesDAO.GetActivitiesViewModel(); return(View(model)); }
public IActionResult RoomsManagement() { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?Area=Receptionists&Ctrl=Rooms&Act=RoomsManagement")); } RoomsManagerViewModel model = new RoomsManagerViewModel(); model.RoomModels = RoomsDAO.GetAllRoomsModel(); model.RoomSizes = RoomSizeDAO.GetAllRoomSize(); model.RoomStyles = RoomStyleDAO.GetAllRoomStyle(); model.RoomTypeModels = RoomTypeDAO.GetAllRoomTypeModel(); return(View(model)); }
//[Area("Receptionists")] //public IActionResult Index() //{ // if (!Authentication.AuthenticateByCookie(HttpContext)) // return Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Bookings&act=Index"); // return View(); //} public IActionResult Index(DateTime fromdate, DateTime todate) { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Bookings&act=Index")); } BookingDAO.Update(); if (fromdate == DateTime.MinValue || todate == DateTime.MinValue) { fromdate = DateTime.Now.AddDays(-30); todate = DateTime.Now.AddDays(30); } List <BookingModel> list = BookingDAO.GetBookingsViewModel(fromdate, todate); return(View(list)); }
public IActionResult Checkin(int id, bool isEdit = true) { if (!Authentication.AuthenticateByCookie(HttpContext)) { return(Redirect("/Receptionists/Authentication/Login?are=Receptionists&ctrl=Activities&act=Checkin")); } ViewBag.isEdit = isEdit; BookingModel model = BookingDAO.GetBookingModel(id); if (StayDAO.GetALLGuestsOfBooking(id).Count == 0) { StayDAO.InsertStay(new Stay() { BookingID = model.BookingID, Status = null, FromDate = DateTime.Now, GuestID = model.Guest.GuestID, ToDate = null }); } return(View(model)); }