public ActionResult ThueXe() { SetDefaultAttribute(); ViewBag.tour = "XE"; var model = new DatTourTrongNuocModel(); return(View("ThueXe", model)); }
public ActionResult DatVeMayBay() { SetDefaultAttribute(); ViewBag.tour = "BAY"; var model = new DatTourTrongNuocModel(); return(View("DatVeMayBay", model)); }
public ActionResult XacNhanThueXe(DatTourTrongNuocModel datTourTrongNuocModel) { // tao order moi var order = new Order(); order.CustomerAddress = datTourTrongNuocModel.customerAddress; order.CustomerEmail = datTourTrongNuocModel.customerEmail; order.CustomerName = datTourTrongNuocModel.customerName; order.CustomerPhone = datTourTrongNuocModel.customerPhone; order.Note = datTourTrongNuocModel.note; order.ProductScheduleId = 3; order.IsDeleted = false; order.Type = "Xe"; order.OrderTotal = 0; // luu order moi vao database _orderService.CreateOrder(order); // lay cac attribute order var listOrderAttribute = _orderAttributeService.GetOrderAttributes().Where(oa => oa.Type == "Lịch trình").ToList(); // mapping order order.OrderAttributeMappings = new List <OrderAttributeMapping>(); foreach (var item in listOrderAttribute) { var temp = ""; switch (item.Name) { case "Số lượng người lớn": temp = datTourTrongNuocModel.quantityAdult.ToString(); break; case "Số lượng trẻ em": temp = datTourTrongNuocModel.quantityChild.ToString(); break; case "Số lượng em bé": temp = datTourTrongNuocModel.quantityBaby.ToString(); break; } order.OrderAttributeMappings.Add(new OrderAttributeMapping { OrderId = order.Id, OrderAttributeId = item.Id, Value = temp }); } _orderService.EditOrder(order); ViewBag.tour = "XE"; SetDefaultAttribute(); return(View("CamOn")); }
public ActionResult XemLaiThongTinDatTourNuocNgoai(DatTourTrongNuocModel datTourTrongNuocModel) { SetDefaultAttribute(); ViewBag.tour = "NƯỚC NGOÀI"; datTourTrongNuocModel.productSchedule = _productScheduleService.GetProductScheduleById(datTourTrongNuocModel.productSchedule.Id); if (datTourTrongNuocModel.productSchedule.IsDeleted || !datTourTrongNuocModel.productSchedule.IsAvailable) { return(View("Error")); } else { return(View("XemLaiThongTinDatTourTrongNuoc", datTourTrongNuocModel)); } }
public ActionResult DatTourNuocNgoai(String slug, int id) { SetDefaultAttribute(); ViewBag.tour = "NƯỚC NGOÀI"; var model = new DatTourTrongNuocModel(); model.productSchedule = _productScheduleService.GetProductScheduleById(id); if (model.productSchedule.IsDeleted || !model.productSchedule.IsAvailable) { return(View("Error")); } else { return(View("DatTourTrongNuoc", model)); } }
public ActionResult XemLaiThongTinThueXe(DatTourTrongNuocModel datTourTrongNuocModel) { SetDefaultAttribute(); ViewBag.tour = "XE"; return(View("XemLaiThongTinThueXe", datTourTrongNuocModel)); }
public ActionResult XemLaiThongTinDatVeMayBay(DatTourTrongNuocModel datTourTrongNuocModel) { SetDefaultAttribute(); ViewBag.tour = "BAY"; return(View("XemLaiThongTinDatVeMayBay", datTourTrongNuocModel)); }
public ActionResult XacNhanDatTour(DatTourTrongNuocModel datTourTrongNuocModel) { datTourTrongNuocModel.productSchedule = _productScheduleService.GetProductScheduleById(datTourTrongNuocModel.productSchedule.Id); if (datTourTrongNuocModel.productSchedule.IsDeleted || !datTourTrongNuocModel.productSchedule.IsAvailable) { return(View("Error")); } else { // tao order moi var order = new Order(); order.CustomerAddress = datTourTrongNuocModel.customerAddress; order.CustomerEmail = datTourTrongNuocModel.customerEmail; order.CustomerName = datTourTrongNuocModel.customerName; order.CustomerPhone = datTourTrongNuocModel.customerPhone; order.ProductScheduleId = datTourTrongNuocModel.productSchedule.Id; order.Note = datTourTrongNuocModel.note; order.IsDeleted = false; order.Type = "Lịch trình"; order.OrderTotal = datTourTrongNuocModel.productSchedule.Price; // luu order moi vao database _orderService.CreateOrder(order); // lay cac attribute order var listOrderAttribute = _orderAttributeService.GetOrderAttributes().Where(oa => oa.Type == "Lịch trình").ToList(); // mapping order order.OrderAttributeMappings = new List <OrderAttributeMapping>(); foreach (var item in listOrderAttribute) { var temp = ""; switch (item.Name) { case "Số lượng người lớn": temp = datTourTrongNuocModel.quantityAdult.ToString(); break; case "Số lượng trẻ em": temp = datTourTrongNuocModel.quantityChild.ToString(); break; case "Số lượng em bé": temp = datTourTrongNuocModel.quantityBaby.ToString(); break; } order.OrderAttributeMappings.Add(new OrderAttributeMapping { OrderId = order.Id, OrderAttributeId = item.Id, Value = temp }); } _orderService.EditOrder(order); if (datTourTrongNuocModel.productSchedule.Product.ProductCategory.Name == "Tour trong nước") { ViewBag.tour = "TRONG NƯỚC"; } else { ViewBag.tour = "NƯỚC NGOÀI"; } SetDefaultAttribute(); return(View("CamOn")); } }