/// <summary> /// add an agency to the collection /// </summary> /// <param name="agency">agency</param> /// <returns>true if success, false else</returns> public bool AddAgency(Tour_Agency agency) { if (agency.AgencyID < nextAgencyNumber) return false; if (!myDal.AddAgency(agency)) return false; nextAgencyNumber = agency.AgencyID + 1; return true; }
//Constructor public Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, uint days = 1, uint beds = 1) { this.agency = agency; this.arrivalDate = arrivalDate; this.beds = beds; this.days = days; this.reservationDate = DateTime.Now; this.reservationID = ID; }
/// <summary> /// Constructor - by leaving date /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="leavingDate">leaving Date</param> /// <param name="reservationDate">reservation date, null is current date</param> public Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, DateTime leavingDate, DateTime?reservationDate = null) { ReservationID = ID; AgencyID = agency.AgencyID; ContactPerson = agency.ContactPerson; ArrivalDate = arrivalDate; Days = (uint)((leavingDate - arrivalDate).Days); ReservationDate = reservationDate == null ? DateTime.Now : (DateTime)reservationDate; }
/// <summary> /// Constructor - by days (default: one day) /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="days">the amount of days</param> /// <param name="reservationDate">reservation date, null is current date</param> public Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, uint days = 1, DateTime?reservationDate = null) { ReservationID = ID; AgencyID = agency.AgencyID; ContactPerson = agency.ContactPerson; ArrivalDate = arrivalDate; Days = days; ReservationDate = reservationDate == null ? DateTime.Now : (DateTime)reservationDate; }
/// <summary> /// Constructor - by leaving date /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="leavingDate">leaving Date</param> /// <param name="reservationDate">reservation date, null is current date</param> public Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, DateTime leavingDate, DateTime? reservationDate = null) { ReservationID = ID; AgencyID = agency.AgencyID; ContactPerson = agency.ContactPerson; ArrivalDate = arrivalDate; Days = (uint)((leavingDate - arrivalDate).Days); ReservationDate = reservationDate == null ? DateTime.Now : (DateTime)reservationDate; }
/// <summary> /// Constructor - by days (default: one day) /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="days">the amount of days</param> /// <param name="reservationDate">reservation date, null is current date</param> public Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, uint days = 1, DateTime? reservationDate = null) { ReservationID = ID; AgencyID = agency.AgencyID; ContactPerson = agency.ContactPerson; ArrivalDate = arrivalDate; Days = days; ReservationDate = reservationDate == null ? DateTime.Now : (DateTime)reservationDate; }
/// <summary> /// Constructor - by days (default: one day) /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="room">The room</param> /// <param name="days">the amount of days</param> /// <param name="reservationDate">reservation date, null is current date</param> public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, uint days = 1, DateTime? reservationDate = null) : base(ID, agency, arrivalDate, days, reservationDate) { Room = room; }
//Constructor public Group_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, T rooms, uint days = 1) : base(ID, agency, arrivalDate, days, Room.calculateBeds(rooms)) { this.rooms = rooms; }
/// <summary> /// Constructor - by leaving date /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="myRooms">collection of rooms</param> /// <param name="leavingDate">leaving Date</param> /// <param name="reservationDate">reservation date, null is current date</param> public Group_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, List <Room> rooms, DateTime leavingDate, DateTime?reservationDate = null) : base(ID, agency, arrivalDate, (uint)((leavingDate - arrivalDate).Days), reservationDate) { Rooms = rooms; }
/// <summary> /// Constructor - by days (default: one day) /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="myRooms">collection of rooms</param> /// <param name="days">the amount of days</param> /// <param name="reservationDate">reservation date, null is current date</param> public Group_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, List <Room> rooms, uint days = 1, DateTime?reservationDate = null) : base(ID, agency, arrivalDate, days, reservationDate) { Rooms = rooms; }
/// <summary> /// Constructor - by leaving date /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="room">The room</param> /// <param name="leavingDate">leaving Date</param> /// <param name="reservationDate">reservation date, null is current date</param> public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, DateTime leavingDate, DateTime?reservationDate = null) : base(ID, agency, arrivalDate, (uint)((leavingDate - arrivalDate).Days), reservationDate) { Room = room; }
/// <summary> /// Constructor - by leaving date /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="myRooms">collection of rooms</param> /// <param name="leavingDate">leaving Date</param> /// <param name="reservationDate">reservation date, null is current date</param> public Group_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, List<Room> rooms, DateTime leavingDate, DateTime? reservationDate = null) : base(ID, agency, arrivalDate, (uint)((leavingDate - arrivalDate).Days), reservationDate) { Rooms = rooms; }
//Constructor public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, uint days = 1) : base(ID, agency, arrivalDate, days, room.Beds) { this.room = room; }
/// <summary> /// Constructor - by leaving date /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="room">The room</param> /// <param name="leavingDate">leaving Date</param> /// <param name="reservationDate">reservation date, null is current date</param> public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, DateTime leavingDate, DateTime? reservationDate = null) : base(ID, agency, arrivalDate, (uint)((leavingDate - arrivalDate).Days), reservationDate) { Room = room; }
/// <summary> /// Constructor - by days (default: one day) /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="room">The room</param> /// <param name="days">the amount of days</param> /// <param name="reservationDate">reservation date, null is current date</param> public Single_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, Room room, uint days = 1, DateTime?reservationDate = null) : base(ID, agency, arrivalDate, days, reservationDate) { Room = room; }
/// <summary> /// Constructor - by days (default: one day) /// </summary> /// <param name="ID">reservation ID</param> /// <param name="agency">Agency (The fields that are in use are agecyID and ContactPerson)</param> /// <param name="arrivalDate">arrival date</param> /// <param name="myRooms">collection of rooms</param> /// <param name="days">the amount of days</param> /// <param name="reservationDate">reservation date, null is current date</param> public Group_Reservation(uint ID, Tour_Agency agency, DateTime arrivalDate, List<Room> rooms, uint days = 1, DateTime? reservationDate = null) : base(ID, agency, arrivalDate, days, reservationDate) { Rooms = rooms; }