public HallModel(int hallID) { //Retreive data from database based on HallID HallModel hall = GetHallByID(hallID); HallId = hall.HallId; HallNumber = hall.HallNumber; RowCap = hall.RowCap; SeatCap = hall.SeatCap; // GetActualSchedule(HallId); }
public static Dictionary <int, List <int> > GetSeats(HallModel hall) { Dictionary <int, List <int> > seats = new Dictionary <int, List <int> >(); for (int i = 1; i < hall.RowCap + 1; i++) { seats.Add(i, new List <int>()); for (int j = 1; j < hall.SeatCap + 1; j++) { seats[i].Add(j); } } return(seats); }
public Dictionary <int, List <int> > CheckSeats() { Dictionary <int, List <int> > totalSeats = HallModel.GetSeats(this.Hall); foreach (KeyValuePair <int, List <int> > row in totalSeats) { foreach (int[] item in GetSeats()) { if (row.Key == item[0]) { row.Value.Remove(item[1]); } } } return(totalSeats); }