This commit includes functionality for many of the models that the program will use. The transaction model, rate, and room model have been implemented, but still need further review to determine if they are finished. The same applies to guest and reservation. Currently all models include a simple list class, the decision to use a database or a serialized object (JSON, array, list, etc). These lists are currently a placeholder and are not guaranteed to land in main.
85 lines
1.9 KiB
C#
85 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
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)
|
|
{
|
|
Status = ReservationStatus.Changed;
|
|
Type = type;
|
|
}
|
|
internal void CancelReservation()
|
|
{
|
|
Status = ReservationStatus.Cancelled;
|
|
}
|
|
}
|
|
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>();
|
|
}
|
|
}
|
|
}
|