Пример #1
0
 /// <summary>
 /// Create a new Room form
 /// </summary>
 /// <param name="centre">Centre the new Room is in</param>
 internal MeetingRoomForm(MeetingCentre centre)
 {
     this._name            = string.Empty;
     this._code            = string.Empty;
     this._description     = string.Empty;
     this._capacity        = 0;
     this._videoConference = false;
     this.Instance         = null;
     this.Centre           = centre;
     this.PropertyChanged  = null;
 }
Пример #2
0
 /// <summary>
 /// Create a Form from a Room
 /// </summary>
 /// <param name="room">Source MeetingRoom</param>
 internal MeetingRoomForm(MeetingRoom room)
 {
     this._name            = room.Name;
     this._code            = room.Code;
     this._description     = room.Description;
     this._capacity        = room.Capacity;
     this._videoConference = room.VideoConference;
     this.Instance         = room;
     this.Centre           = null;
     this.PropertyChanged  = null;
 }
Пример #3
0
 /// <summary>
 /// Sets the value of MeetingRoom.
 /// Used for importing from JSON and XML.
 /// </summary>
 /// <param name="room">Assigning MeetingRoom</param>
 internal void AssignMeetingRoom(MeetingRoom room)
 {
     if (this.MeetingRoom is null)
     {
         this.MeetingRoom = room;
     }
     else
     {
         throw new System.Exception("Meeting Room has already been set");
     }
 }
Пример #4
0
 /// <summary>
 /// Saves the form data to it's source MeetingRoom or to a new MeetingRoom
 /// </summary>
 /// <returns>Saved MeetingRoom</returns>
 public MeetingRoom Save()
 {
     if (this.Instance is null)
     {
         this.Instance = new MeetingRoom(this.Centre);
     }
     this.Instance.Name            = this.Name;
     this.Instance.Code            = this.Code;
     this.Instance.Description     = this.Description;
     this.Instance.Capacity        = this.Capacity;
     this.Instance.VideoConference = this.VideoConference;
     return(this.Instance);
 }
Пример #5
0
 /// <summary>
 /// Creates a Form for a new Reservation
 /// </summary>
 /// <param name="room">Room the Reservation is for</param>
 /// <param name="date">Date the Reservation is taking place</param>
 public MeetingReservationForm(MeetingRoom room, DateTime date)
 {
     this.Room = room;
     this.Date = date;
 }
Пример #6
0
 /// <summary>
 /// Creates a Form for a new MeetingReservation
 /// </summary>
 /// <param name="room">MeetingRoom the Reservation is for</param>
 /// <param name="date">Date the Reservation is taking place</param>
 /// <returns></returns>
 public static MeetingReservationForm GetNewForm(MeetingRoom room, DateTime date)
 {
     return(new MeetingReservationForm(room, date));
 }