public AllSeats CreateSeatEntity(int seatNumber, string rowNumber, int loungeId) { AllSeats seat = new AllSeats(); seat.seatNumber = seatNumber; seat.rowNumber = rowNumber; seat.loungeId = loungeId; return(seat); }
private void CalculateAvailableSeats() { this.AvailableSeats = new List <Seat>(); this.AvailableSeats.AddRange(AllSeats.FindAll(seat => !seat.IsBooked)); }
public override string ToString() { return("Seat" + AllSeats.ToString()); }
public void GetHall(Tuple <int, int, int, int, double, double, double> HallInfo, List <Tuple <double, int, int, string, bool> > Seats) { int multiplierX = 0; int multiplierY = 0; if (HallNumber == 1) { multiplierX = 100; multiplierY = 40; } else if (HallNumber == 2) { multiplierX = 65; multiplierY = 30; } else if (HallNumber == 3) { multiplierX = 40; multiplierY = 25; } else { Console.WriteLine("Something went wrong"); } for (int i = 0; i < HallInfo.Item1; i++) { for (int j = 0; j < HallInfo.Item2; j++) { for (int z = 0; z < Seats.Count; z++) { if (Seats[z].Item2 == i && Seats[z].Item3 == j) { if (Seats[z].Item5) { if (Seats[z].Item1 == HallInfo.Item5) { Color color = Color.FromArgb(250, 250, 0); Point position = new Point(25 + (j * multiplierX), 25 + (i * multiplierY)); Size dimenision = new Size(multiplierX - 5, multiplierY - 5); bool avail = Seats[z].Item5; double price = Seats[z].Item1; Tuple <Point, Size, Color, bool, double> data = new Tuple <Point, Size, Color, bool, double>(position, dimenision, color, avail, price); AllSeats.Add(data); } else if (Seats[z].Item1 == HallInfo.Item6) { Color color = Color.FromArgb(0, 0, 250); Point position = new Point(25 + (j * multiplierX), 25 + (i * multiplierY)); Size dimenision = new Size(multiplierX - 5, multiplierY - 5); bool avail = Seats[z].Item5; double price = Seats[z].Item1; Tuple <Point, Size, Color, bool, double> data = new Tuple <Point, Size, Color, bool, double>(position, dimenision, color, avail, price); AllSeats.Add(data); } else if (Seats[z].Item1 == HallInfo.Item7) { Color color = Color.FromArgb(0, 250, 0); Point position = new Point(25 + (j * multiplierX), 25 + (i * multiplierY)); Size dimenision = new Size(multiplierX - 5, multiplierY - 5); bool avail = Seats[z].Item5; double price = Seats[z].Item1; Tuple <Point, Size, Color, bool, double> data = new Tuple <Point, Size, Color, bool, double>(position, dimenision, color, avail, price); AllSeats.Add(data); } } else if (Seats[z].Item4 == "(No Seat)") { //idk } else { Color color = Color.FromArgb(250, 0, 0); Point position = new Point(25 + (j * multiplierX), 25 + (i * multiplierY)); Size dimenision = new Size(multiplierX - 5, multiplierY - 5); bool avail = Seats[z].Item5; double price = Seats[z].Item1; Tuple <Point, Size, Color, bool, double> data = new Tuple <Point, Size, Color, bool, double>(position, dimenision, color, avail, price); AllSeats.Add(data); } break; } } } } }