public Task <DiscountDTO> GetDiscountByBookingTypeAsync(BookingTypes type) { var discounts = from discount in _discountRepo.GetAll() where discount.BookingType == type && discount.Active select new DiscountDTO { Id = discount.Id, BookingTypeName = discount.BookingType.ToString(), BookingType = discount.BookingType, AdultDiscount = discount.AdultDiscount, MinorDiscount = discount.MinorDiscount, MemberDiscount = discount.MemberDiscount, ReturnDiscount = discount.ReturnDiscount, PromoDiscount = discount.PromoDiscount, AppDiscountIos = discount.AppDiscountIos, AppDiscountAndroid = discount.AppDiscountAndroid, AppDiscountWeb = discount.AppDiscountWeb, AppReturnDiscountIos = discount.AppReturnDiscountIos, AppReturnDiscountAndroid = discount.AppReturnDiscountAndroid, AppReturnDiscountWeb = discount.AppReturnDiscountWeb, Active = discount.Active, DateCreated = discount.CreationTime, DateModified = discount.LastModificationTime, CustomerDiscount = discount.CustomerDiscount }; return(discounts.AsNoTracking().FirstOrDefaultAsync()); }
/// <summary> /// Creates an object of a Data Access Implementor /// </summary> /// <param name="type"></param> /// <exception cref="InvalidBookingTypeDAOException</exception> /// <returns>Returns an interface for one the booking types supplied</returns> public IBookingDAOImpl Create(BookingTypes type) { IBookingDAOImpl bookings = null; bookings = s_bookingDAOs[type]; return(bookings); }
public async Task <IActionResult> ContinueLater(BookingTypes bookingType, string bookingReference) { var bookingModel = await _bookingService.GetBookingAsync(bookingReference); var model = bookingModel.MapToDocumentOrderViewModel(); return(View(model)); }
/// <summary> /// Creates an object of a Data Access Implementor /// </summary> /// <param name="type"></param> /// <exception cref="InvalidBookingTypeDAOException</exception> /// <returns>Returns an interface for one the booking types supplied</returns> public IBookingDAOImpl Create(BookingTypes type) { if (bookingDAOImpls[type] == null) { throw new InvalidBookingTypeDAOException("Invalid Booking Type"); } return(bookingDAOImpls[type]); }
public void UpdateBookingAccount(BookingTypes bookingType, PaymentMethod paymentMethod, string refCode, Guid vehicletripRegId, decimal amount, TransactionType transType = TransactionType.Credit) { if ( (bookingType == BookingTypes.Advanced || bookingType == BookingTypes.Terminal) && (paymentMethod == PaymentMethod.Cash || paymentMethod == PaymentMethod.CashAndPos) ) { AddEntry(vehicletripRegId, refCode, amount, transType); } }
/// <summary> /// Creates an object of a Data Access Implementor /// </summary> /// <param name="type"></param> /// <exception cref="InvalidBookingTypeDAOException</exception> /// <returns>Returns an interface for one the booking types supplied</returns> public IBookingDAOImpl Create(BookingTypes type) { IBookingDAOImpl bookings = null; if (type == BookingTypes.Flight) { bookings = new AirTravelBookingDAOImpl(); } return(bookings); }
private string CheckProvidedAgainstRequired() { var result = new StringBuilder(); AppendIfNotEmpty(result, FlowConfiguration.Check()); AppendIfNotEmpty(result, BookingTypes.Check()); AppendIfNotEmpty(result, StatusDefinition.Check()); AppendIfNotEmpty(result, Dependency.Check()); AppendIfNotEmpty(result, LogicComponent.Check()); return(result.ToString()); }
public async Task <IActionResult> OrderDocuments(BookingTypes bookingType, int readerticket, string bookingReference) { var bookingModel = await _bookingService.GetBookingAsync(readerticket, bookingReference); if (bookingModel.BookingStatus == BookingStatuses.Created) { var model = bookingModel.MapToDocumentOrderViewModel(); return(View(model)); } return(RedirectToAction("Error", "Home")); }
/// <summary> /// Gets the instance of Booking Data Access Object as this a singleton /// </summary> /// <exception cref="InvalidBookingTypeDAOException">Throws an exception if an invalid booking type</exception> /// <returns>Instance of the Booking Data Access Object</returns> public static BookingDAO GetInstance(BookingTypes type) { try { daoImpl = BookingDAOImplFactory.GetInstance().Create(type); } catch (InvalidBookingTypeDAOException) { throw; } return(instance); }
/// <summary> /// Adds a booking to the collection /// </summary> /// <param name="NewBooking"></param> /// <param name="type"></param> public void AddBooking(Booking NewBooking, BookingTypes type) { if (bookings[type] == null) { List <Booking> TempBookings = new List <Booking>(); TempBookings.Add(NewBooking); bookings.Add(type, TempBookings); } else { bookings[type].Add(NewBooking); } }
public static string ToStringURL(this BookingTypes bookingTypes) { switch (bookingTypes) { case BookingTypes.StandardOrderVisit: return("standard-order-visit"); case BookingTypes.BulkOrderVisit: return("bulk-order-visit"); default: return(string.Empty); } }
/// <summary> /// Returns the instance of the BookingDAO object as an interface /// </summary> /// <param name="type"></param> /// <exception cref="InvalidBookingTypeDAOException">Throws an exception if booking type is invalid</exception> /// <returns>An Interface for Booking Data Access Objects</returns> public IBookingDAO Create(BookingTypes type) { IBookingDAO bookDAO = null; try { bookDAO = BookingDAO.GetInstance(type); } catch (InvalidBookingTypeDAOException) { throw; } return(bookDAO); }
public async Task <IActionResult> Availability(BookingTypes bookingType, SeatTypes seatType, ErrorCode errorCode) { if (seatType == default(SeatTypes)) { seatType = bookingType == BookingTypes.StandardOrderVisit ? SeatTypes.StdRRSeat : SeatTypes.BulkOrderSeat; } var model = new AvailabilityViewModel { BookingType = bookingType, SeatType = seatType, AvailableBookings = await _availabilityService.GetAvailabilityAsync(seatType), ErrorMessage = errorCode.ToMessage() }; return(View(model)); }
public Task <List <PassengerDto> > GetAllPassengersInTrip(Guid VehicleTripId, int bookingtype) { var booking = new BookingTypes(); if (bookingtype == 4) { booking = BookingTypes.All; } if (bookingtype == 2) { booking = BookingTypes.Online; } if (bookingtype == 1) { booking = BookingTypes.Advanced; } if (bookingtype == 0) { booking = BookingTypes.Terminal; } var passengers = from pass in _seatManagementService.GetAll() join manifest in _manRepo.GetAll() on pass.VehicleTripRegistrationId equals manifest.VehicleTripRegistrationId join route in _routerepo.GetAll() on pass.RouteId equals route.Id where pass.VehicleTripRegistrationId == VehicleTripId && (booking != BookingTypes.All ? pass.BookingType == booking : pass.VehicleTripRegistrationId == VehicleTripId) select new PassengerDto { Amount = pass.Amount, BookingReferenceCode = pass.BookingReferenceCode, FullName = pass.FullName, Gender = pass.Gender, PhoneNumber = pass.PhoneNumber, SeatNumber = pass.SeatNumber, Route = route.Name, BookingType = pass.BookingType, Dispatch = manifest.Dispatch }; return(Task.FromResult(passengers.ToList())); }
static BookingDAOImplFactory() { AppSettingsReader asr = new AppSettingsReader(); string bookingConfig = asr.GetValue("bookingDAOTypes", typeof(string)).ToString(); string[] tokens = bookingConfig.Split(':'); for (int i = 0; i < tokens.Length;) { BookingTypes bt = (BookingTypes)Convert.ToInt32(tokens[i]); string className = tokens[i + 1]; Assembly asm = Assembly.GetExecutingAssembly(); object objBookingDAO = asm.CreateInstance(className); IBookingDAOImpl bookingDAOImpl = (IBookingDAOImpl)objBookingDAO; s_bookingDAOs.Add(bt, bookingDAOImpl); i += 2; } }
public async Task <ActionResult <List <Seat> > > GetAllAvailabileSeats(DateTime availableOn, BookingTypes bookingType, bool includeManagerialDiscretion = false) { var result = await _availabilityService.GetAllAvailabileSeatsAsync(availableOn, bookingType, includeManagerialDiscretion); return(Ok(result)); }
public IActionResult ThankYou(BookingTypes bookingType) { return(View()); }
/// <summary> /// Gets all the bookings for a particular booking type /// </summary> /// <param name="type"></param> /// <returns></returns> public List <Booking> GetBookings(BookingTypes type) { return(bookings[type]); }
public async Task <List <SeatModel> > GetAllAvailabileSeatsAsync(DateTime availableOn, BookingTypes bookingType, bool includeManagerialDiscretion) { var seatTypes = bookingType == BookingTypes.StandardOrderVisit ? StandardOrderSeats.Select(s => (int)s).ToList() : BulkOrderSeats.Select(s => (int)s).ToList(); if (includeManagerialDiscretion) { seatTypes.Add((int)SeatTypes.ManagerialDiscretion); } var availableSeats = await(from seat in _context.Set <Seat>().Where(s => seatTypes.Contains(s.SeatTypeId)) join booking in _context.Set <Booking>().Where(b => b.VisitStartDate == availableOn && (BookingStatuses)b.BookingStatusId != BookingStatuses.Cancelled) on seat.Id equals booking.SeatId into lj from subseat in lj.DefaultIfEmpty() where subseat == null select new Seat { Id = seat.Id, Number = seat.Number, SeatType = seat.SeatType, SeatTypeId = seat.SeatTypeId }).ToListAsync(); var seatModels = availableSeats.OrderBy(s => s.Number).Select(s => new SeatModel() { Id = s.Id, Number = s.Number, SeatType = (SeatTypes)s.SeatType.Id }).ToList(); return(seatModels); }
internal void RequireBookingType(string source, string bookingType) { BookingTypes.Require(source, bookingType); }
internal void ProvideBookingType(string source, string bookingType) { BookingTypes.Provide(source, bookingType); }