private void CustomerDataRecord2_FormClosing(object sender, FormClosingEventArgs e) { this.Hide(); frmCustomerMgmt frm = new frmCustomerMgmt(); frm.ShowDialog(); }
private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { DataGridViewRow drow = dataGridView1.SelectedRows[0]; this.Hide(); frmCustomerMgmt frm = new frmCustomerMgmt(); frm.Show(); frm.txtCustomerID.Text = drow.Cells[0].Value.ToString(); frm.txtCustomerName.Text = drow.Cells[1].Value.ToString(); frm.txtAddress.Text = drow.Cells[2].Value.ToString(); frm.txtPlace.Text = drow.Cells[3].Value.ToString(); frm.txtCity.Text = drow.Cells[4].Value.ToString(); frm.cmbZone.Text = drow.Cells[5].Value.ToString(); frm.txtPostalCode.Text = drow.Cells[6].Value.ToString(); frm.txtPhone.Text = drow.Cells[7].Value.ToString(); frm.txtMobile.Text = drow.Cells[8].Value.ToString(); frm.txtFax.Text = drow.Cells[9].Value.ToString(); frm.txtEmail.Text = drow.Cells[10].Value.ToString(); frm.txtNote.Text = drow.Cells[11].Value.ToString(); frm.btnUpdate.Enabled = true; frm.btnDelete.Enabled = true; frm.btnRegister.Enabled = false; frm.txtCustomerName.Focus(); } catch (SqlException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnCustomerManagement_Click(object sender, EventArgs e) { frmCustomerMgmt frm = new frmCustomerMgmt(); frm.ShowDialog(); }