Пример #1
0
 private void DleteSeedlessnessButton_Click(object sender, EventArgs e)
 {
     var selectedRows = SeedlessnessTable.SelectedRows;
     foreach (DataGridViewRow row in selectedRows)
     {
         int id = Convert.ToInt32(row.Cells[0].Value);
         SeedlessnessManager.DeleteData(id);
         SeedlessnessType local = SeedlessnessList.Find(x => x.Id == id);
         SeedlessnessList.Remove(local);
     }
     UpdateSeednesslessTable();
 }
Пример #2
0
 public void LoadAllData()
 {
     WineList                     = WineManager.GetData();
     GrapeSortList                = SortManager.GetData();
     CountryList                  = CountryManager.GetData();
     SweetnessList                = SweetnessManager.GetData();
     SeedlessnessList             = SeedlessnessManager.GetData();
     SortCategoryList             = WineSortManager.GetData();
     WineTable.DataSource         = WineList;
     GrapeSortTable.DataSource    = GrapeSortList;
     SweetnessTable.DataSource    = SweetnessList;
     SeedlessnessTable.DataSource = SeedlessnessList;
     CountryTable.DataSource      = CountryList;
     WineSortTable.DataSource     = SortCategoryList;
 }
Пример #3
0
        private void InitSqlManagers()
        {
            SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();

            builder.DataSource         = "ALEX-ПК\\SQLEXPRESS";
            builder.InitialCatalog     = "WineryDb";
            builder.IntegratedSecurity = true;
            WineManager         = new WineManager(builder.ConnectionString);
            SortManager         = new SortManager(builder.ConnectionString);
            CountryManager      = new CountryManager(builder.ConnectionString);
            SeedlessnessManager = new SeedlessnessManager(builder.ConnectionString);
            SweetnessManager    = new SweetnessManager(builder.ConnectionString);
            WineSortManager     = new WineSortManager(builder.ConnectionString);
            DbSearch            = new SearchManager(builder.ConnectionString);
        }