public PaymentPage() { InitializeComponent(); //this.BackgroundColor = Color.FromRgb(0, 200, 255); this.BackgroundColor = Color.White; paymentLabel.FontFamily = Device.RuntimePlatform == Device.iOS ? "Cabin-Bold" : "Cabin-Bold.ttf#Cabin-Bold"; if (Device.RuntimePlatform == Device.Android) { NavigationPage.SetHasBackButton(this, false); } ExceptionModel.ExceptionModelInstance = new ExceptionModel(); pricingManager = new PricingManager(); manager = new BookingsManager(); emailService = new EmailService(); var viewModel = new PaymentPageViewModel(new StripeRepository(), new APIRepository()); this.BindingContext = viewModel; }
// ------------------------ END DongMing Hu ------------------------- // GET: Bookings by customer (Customer Booking History) public ActionResult CustomerHistory() { if (HttpContext.Session.GetObject <CustomerProfileManager>("login") != null) { //var cust = HttpContext.Session.TryGetValue("login", ); var cust = HttpContext.Session.GetObject <Customers>("login"); // Change this to Id retrieved from sessions int id = cust.CustomerId; var bookings = BookingsManager.GetAllBookingsByCustomer(id) .Select(bk => new BookingsModel { BookingId = bk.BookingId, BookingDate = bk.BookingDate, BookingNo = bk.BookingNo, TravelerCount = bk.TravelerCount, CustomerId = bk.Customer.CustFirstName, TripTypeId = bk.TripType.Ttname, PackageId = bk.Package.PkgName, Price = Math.Round((decimal)(bk.Package.PkgBasePrice + bk.Package.PkgAgencyCommission), 0), //Total = TotalOwing(bk.Package.PkgBasePrice).ToString("c") }).ToList(); return(View(bookings)); } else { return(View("Login")); //return RedirectToAction("Login"); } }
public void Setup() { config = new BookingConfiguration { TimeBlockLength = TimeSpan.FromMinutes(30) }; repo = new FakeBookingsRepo(); mgr = new BookingsManager <Appointment, AppointmentType, AvailabilityItem>(repo, config); }
public IActionResult Booking(int Packageid) { var userX = CustomerManager.FindCustomerId(User.Identity.Name); int CustomerId = userX.CustomerId; //var package = PackagesManager.GetPackagesById(Packageid); //if (package == null) //{ // return NotFound(); //} //create a booking object & add to database var booking = BookingsManager.CreateBooking(Packageid, CustomerId); BookingsManager.Add(booking); //retrieve booking information from database for display var pId = BookingsManager.GetBookingByCustomer(CustomerId); decimal total = 0; var pck = new List <Packages>(); foreach (int item in pId) { try { var packageselected = PackageManager.GetPackagesById(item); try { if (packageselected != null) { pck.Add(packageselected); total += packageselected.PkgBasePrice; } } catch { continue; } } catch { continue; } } ViewBag.Total = Math.Round((total), 2); ViewBag.selectedPackages = pck; // ViewBag.Package = package; ViewBag.CustomerId = CustomerId; return(View()); }
// GET: Bookings by customer (Customer Booking History) // This has been moved to CustomersController public ActionResult CustomerHistory() { // Change this to Id retrieved from sessions int id = 143; var bookings = BookingsManager.GetAllBookingsByCustomer(id) .Select(bk => new BookingsModel { BookingId = bk.BookingId, BookingDate = bk.BookingDate, BookingNo = bk.BookingNo, TravelerCount = bk.TravelerCount, CustomerId = bk.Customer.CustFirstName, TripTypeId = bk.TripType.Ttname, PackageId = bk.Package.PkgName }).ToList(); return(View(bookings)); }
public PaymentPage() { InitializeComponent(); //this.BackgroundColor = Color.FromRgb(0, 200, 255); this.BackgroundColor = Color.White; ExceptionModel.ExceptionModelInstance = new ExceptionModel(); pricingManager = new PricingManager(); manager = new BookingsManager(); emailService = new EmailService(); var viewModel = new PaymentPageViewModel(new StripeRepository(), new APIRepository()); this.BindingContext = viewModel; }
public ActionResult BookingDetail(int id) { var booking = BookingsManager.Find(id); var a = new BookingsModel { BookingId = booking.BookingId, BookingNo = booking.BookingNo, PkgStartDate = booking.Package.PkgStartDate, PkgEndDate = booking.Package.PkgEndDate, TravelerCount = booking.TravelerCount, CustomerId = booking.Customer.CustFirstName, TripTypeId = booking.TripType.Ttname, PkgDesc = booking.Package.PkgDesc, PackageId = booking.Package.PkgName, Price = Math.Round((decimal)(booking.Package.PkgBasePrice + booking.Package.PkgAgencyCommission), 0), }; return(View(a)); }
private void InstanceMembers() { _whManager = new DayWorkingHoursManager(); _dayAgendasManager = new DayAgendasManager(); _holidayManager = new HolidayManager(); _bookingsManager = new BookingsManager(); }