Exemple #1
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            DeletingFromDateBase deleting = new DeletingFromDateBase();

            deleting.DeleteFromDatabase(filmsList.Films[indexRow]);
            filmsList.Films.RemoveAt(indexRow);
            sourceData.ResetBindings(false); //подтверждает изменения
        }
Exemple #2
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            DeletingFromDateBase deleting = new DeletingFromDateBase();

            deleting.DeleteFromDatabase(sessionsList.Sessions[indexRow]);
            sessionsList.Sessions.RemoveAt(indexRow);
            LoadDataGridView();
        }
Exemple #3
0
 private void DeleteButton_Click(object sender, EventArgs e)
 {
     ClearAllTextBoxesAndGroupBox();
     if (indexRow != -1)
     {
         DeletingFromDateBase deleting = new DeletingFromDateBase();
         deleting.DeleteFromDatabase(hallsList.Halls[indexRow]);
         deleting.DeleteFromDatabase(hallsList.Halls[indexRow].Places);
         hallsList.Halls.RemoveAt(indexRow);
         ReadingFromDateBase reading = new ReadingFromDateBase();
         placesList = reading.ReadAllPlacesOfAllHalls();
         sourceData.ResetBindings(false);
     }
 }
Exemple #4
0
 private void UpdateButton_Click(object sender, EventArgs e)
 {
     if (indexRow != -1)
     {
         hallsList.Halls[indexRow].HallName        = NameHallInput.Text;
         hallsList.Halls[indexRow].PlacesInRow     = Convert.ToInt32(PlacesInRowInput.Text);
         hallsList.Halls[indexRow].SeatingCapacity = Convert.ToInt32(SeatingCapacityInput.Text);
         UpdatingDataBase updating = new UpdatingDataBase();
         updating.UpdateInDatabase(hallsList.Halls[indexRow]);
         sourceData.ResetBindings(false); //подтверждает изменения
         HallPlaces.Controls.Clear();
         DeletingFromDateBase deleting = new DeletingFromDateBase();
         deleting.DeleteFromDatabase(hallsList.Halls[indexRow].Places);
         hallsList.Halls[indexRow].Places.Clear();
         ReadingFromDateBase reading = new ReadingFromDateBase();
         placesList = reading.ReadAllPlacesOfAllHalls();
         FillingPlaces(hallsList.Halls[indexRow]);
         LoadSchemeOfHall(hallsList.Halls[indexRow].SeatingCapacity, hallsList.Halls[indexRow].PlacesInRow);
     }
 }