private void submitBtn_Click(object sender, EventArgs e) { string name = nameTxtBx.Text; string details = descriptionTxtBx.Text; string plcAddress = plcTB.Text; string contacts = contactsTB.Text; string logonDetails = logonTB.Text; if (versionGrid.Rows.Count != 0) { int versionPK = (int)versionGrid.SelectedRows[0].Cells["PK"].Value; Database.InsertCustomer(name, details, plcAddress, contacts, logonDetails, versionPK); } else { Database.InsertCustomer(name, details, plcAddress, contacts, logonDetails); } MessageBox.Show("Completed!"); DataGridView dgv = mainMenu.getCustomersGrid(); dgv.DataSource = Database.GetCustomerList(); this.Hide(); mainMenu.Show(); }
private void submitBtn_Click(object sender, EventArgs e) { Database.UpdateCustomer(currentPK, nameTxtBx.Text, detailsTxtBx.Text, plcTB.Text, contactsTB.Text, logonTB.Text); MessageBox.Show("Completed!"); DataGridView dgv = customersPage.getCustomersGrid(); dgv.DataSource = Database.GetCustomerList(); this.Hide(); customersPage.Show(); }