private void buttonNew_Click(object sender, EventArgs e) { SupplierCard supplierCard = new SupplierCard(); Supplier supplier = new Supplier(); supplierCard.SetParameters(true, supplier); supplierCard.ShowDialog(); InsertDataIntoTable(); }
private void buttonOpen_Click(object sender, EventArgs e) { if (suppliersTable.SelectedRows.Count > 0) { int id = Convert.ToInt32(suppliersTable.SelectedRows[0].Cells["Id"].Value.ToString()); Supplier supplier = new Supplier(); supplier = supplierRepository.GetSupplierById(id); SupplierCard supplierCard = new SupplierCard(); supplierCard.SetParameters(false, supplier); supplierCard.ShowDialog(); InsertDataIntoTable(); } }