public ActionResult Index(OrderModel model) { SetCurrentMenu(); if (ModelState.IsValid) { var result = _orderRepository.Saving(model.Order); if (result) { SetSuccessMessage("Bạn vừa đặt phòng thành công. Chúng tôi sẽ liên hệ lại ngay với bạn sớm nhất."); } else { AddFailedMessage("Đã có lỗi xảy ra xin vui lòng thử lại."); } } else { foreach (var item in ModelState.Values) { foreach (var error in item.Errors) { SetFailedNotification(error.ErrorMessage); } } } model.RoomTypes = LayoutRepository.FetchRoomTypes(); model.Footer = LayoutRepository.LoadFooterDefaul(); return(View(model)); }
public ActionResult Index() { var model = LayoutRepository.LoadFooterDefaul(); SetCurrentMenu(); return(View(model)); }
public ActionResult Booking(Order order) { SetCurrentMenu(); var model = new OrderModel { RoomTypes = LayoutRepository.FetchRoomTypes(), Order = order, Footer = LayoutRepository.LoadFooterDefaul() }; return(View("Index", model)); }
public ActionResult Index() { SetCurrentMenu(); var model = new OrderModel { RoomTypes = LayoutRepository.FetchRoomTypes(), Order = new Order { CheckIn = DateTime.UtcNow, CheckOut = DateTime.UtcNow.AddDays(1) }, Footer = LayoutRepository.LoadFooterDefaul() }; return(View(model)); }
public ActionResult Send(Contact contact) { var model = LayoutRepository.LoadFooterDefaul(); SetCurrentMenu(); if (contact == null) { SetFailedNotification("Có lỗi xảy ra. Vui lòng thử lại"); return(RedirectToAction("Index")); } if (!ModelState.IsValid) { foreach (var item in ModelState.Values) { foreach (var error in item.Errors) { SetFailedNotification(error.ErrorMessage); } } return(RedirectToAction("Index")); } var message = contact.Id > 0 ? "Cập nhật" : "Thêm"; if (_contactRepository.Save(contact)) { SetSuccessNotification($"{message} liên hệ thành công"); } else { SetFailedNotification("Đã có lỗi xảy ra. Xin vui lòng thử lại"); } return(RedirectToAction("Index")); }
public ActionResult Footer() { var model = LayoutRepository.LoadFooterDefaul(); return(PartialView("_Footer", model)); }