void OnPlaceClick(Button sender, CinemaRoomPlaceTypeAndInfo place, int x, int y) { if (place.IsUsed) { UnsoldNewTicket(x, y); } else { SoldNewTicket(x, y); } }
internal Window_CinemaRoomViewer(DataBaseWorker dbWorker, Seance seance) { dataBaseWorker = dbWorker; currentSeance = seance; Title += " - " + seance.Room.ToString(); cinemaRoomScheme = CinemaRoomPlaceTypeAndInfo.SchemeFromString(currentSeance.Room.RoomScheme); InitializeComponent(); BuildSchemeOnForm(cinemaRoomScheme); SoldTicket[] st = dataBaseWorker.GetAllTicketsOnSeance(currentSeance); HandleSoldTickets(st); UpdateRoom(); }
void AddButtonToForm(CinemaRoomPlaceTypeAndInfo place, int x, int y) { if (place.PlaceType == CinemaRoomPlaceType.NotExists) { return; } Button res = new Button(); placeButtonsArr[x, y] = res; grid.Children.Add(res); res.Click += delegate { OnPlaceClick(res, place, x, y); }; }