private void Formularz_Load(object sender, EventArgs e) { GridFiller.FillProductsGrid(ProductsGrid); GridFiller.FillPricesGrid(CenyGrid); GridFiller.FillPriceListsGrid(CennikiGrid); GridFiller.FillSummaryGrid(PodsumowanieGrid); }
// @@@@@@ CENNIKI @@@@@@ \\ private void AddPriceListBtn_Click(object sender, EventArgs e) { using (var addform = new AddEditCennikiForm(null)) { if (addform.ShowDialog() == DialogResult.Yes) { GridFiller.FillPriceListsGrid(CennikiGrid); } } }
private void EditPriceListBtn_Click(object sender, EventArgs e) { try { using (var addform = new AddEditCennikiForm((Cenniki)CennikiGrid.CurrentRow.DataBoundItem)) { if (addform.ShowDialog() == DialogResult.Yes) { GridFiller.FillPriceListsGrid(CennikiGrid); } } } catch (NullReferenceException exception) { MessageBox.Show(exception.Message, "Błąd", MessageBoxButtons.OK); } }
private void DeletePriceListBtn_Click(object sender, EventArgs e) { try { var cennikToDel = (Cenniki)CennikiGrid.CurrentRow.DataBoundItem; if (MessageBox.Show($"Jesteś pewien że chcesz usunąć Cennik: {cennikToDel.Nazwa}", "Formularz Towarowy", MessageBoxButtons.YesNo) == DialogResult.Yes) { new PriceListBLL().DeletePriceList(cennikToDel); GridFiller.FillPriceListsGrid(CennikiGrid); GridFiller.FillPricesGrid(CenyGrid); } } catch (NullReferenceException exception) { MessageBox.Show(exception.Message, "Błąd", MessageBoxButtons.OK); } }
private void TabControl_SelectedIndexChanged(object sender, EventArgs e) { GridFiller.FillPricesGrid(CenyGrid); GridFiller.FillPriceListsGrid(CennikiGrid); GridFiller.FillSummaryGrid(PodsumowanieGrid); }