Files
ophelias-oasis/OpheliasOasis/Models/Reservation.cs
雲華 349589674f Manager classes added and model updates
This commit introduces a large number of changes. Namely there are a
number of additions to a new set of classes that manage the database
and/ or the models shared between the code and databse. There is
fragmented non-functional code in this commit and there may be debug/
old code that still needs to be removed. This commit is just to version
these changes as they were not commited previously. There is also some
console interface code written, but has next to no functionality
attached to any existing prompts. More details will be published per .cs
file, ie specific manager or model, once they are finished as they are
undergoing rapid and significant changes regularly.
2022-04-11 23:40:37 -04:00

83 lines
1.9 KiB
C#

using Ophelias.Models;
namespace Ophelias.Models
{
internal class Reservation
{
internal int Id;
internal int RoomId;
internal int GuestId;
internal int TransactionId;
internal bool IsNoShow;
internal ReservationType Type;
internal ReservationStatus Status;
internal DateTime CreationDate;
internal DateTime StartDate;
internal DateTime EndDate;
internal DateTime? CheckIn;
internal DateTime? CheckOut;
internal DateTime? DateChanged;
internal Reservation(int id, int gid, int tid, int room, ReservationType type, ReservationStatus status,
DateTime startdate, DateTime enddate)
{
Id = id;
RoomId = room;
GuestId = gid;
TransactionId = tid;
IsNoShow = false;
Type = type;
Status = status;
CreationDate = DateTime.Now;
StartDate = startdate;
EndDate = enddate;
CheckIn = null;
CheckOut = null;
DateChanged = null;
}
internal void ChangeReservation(ReservationType type, Transaction t, BaseRate b)
{
Status = ReservationStatus.Changed;
Type = type;
t.Penalize(this, b.Rate);
}
internal void CancelReservation(Transaction t)
{
Status = ReservationStatus.Cancelled;
t.Penalize(this);
}
}
internal enum ReservationStatus
{
Active,
Changed,
Cancelled,
Ended,
}
internal enum ReservationType
{
Conventional,
Prepaid,
Incentive,
SixtyDayAdvance,
}
internal class ReservationList
{
internal List<Reservation> Reservations;
internal ReservationList()
{
Reservations = new List<Reservation>();
}
}
}