private void buttonAddBrandShoe_Click(object sender, EventArgs e) { var brandBrandShoeName = textBoxBrandShoeName.Text; var brandCountryShoe = textBoxCountryShoe.Text; BrandShoes brandShoe = new BrandShoes { BrandName = brandBrandShoeName, Country = brandCountryShoe }; _brandsShoe.Create(brandShoe); _brandsShoe.Save(); LoadBrandsShoe(); }
private void buttonEditBrandShoe_Click(object sender, EventArgs e) { var selectedBrandShoeIndex = Int32.Parse(dataGridViewBrandsShoe.SelectedRows[0].Cells[0].Value.ToString()); _brandsShoe.DeleteById(selectedBrandShoeIndex); _brandsShoe.Save(); LoadBrandsShoe(); var brandBrandShoeName = textBoxBrandShoeName.Text; var brandCountryShoe = textBoxCountryShoe.Text; BrandShoes brandShoe = new BrandShoes { BrandName = brandBrandShoeName, Country = brandCountryShoe }; _brandsShoe.Create(brandShoe); _brandsShoe.Save(); LoadBrandsShoe(); }