private void btnEditCustomer_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count != 0) { frmCustomer fo = new frmCustomer(); fo.strAction = "EDITCUSTOMER"; //fo.cmbAccessLevel.SelectedIndex = 0; fo.txtCode.ReadOnly = true; fo.ID = long.Parse(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString()); fo.txtCode.Text = dataGridView1[1, dataGridView1.CurrentRow.Index].Value.ToString(); fo.txtFullName.Text = dataGridView1[2, dataGridView1.CurrentRow.Index].Value.ToString(); fo.txtTel1.Text = dataGridView1[3, dataGridView1.CurrentRow.Index].Value.ToString(); fo.txtTel2.Text = dataGridView1[4, dataGridView1.CurrentRow.Index].Value.ToString(); fo.txtCell1.Text = dataGridView1[5, dataGridView1.CurrentRow.Index].Value.ToString(); fo.txtCell2.Text = dataGridView1[6, dataGridView1.CurrentRow.Index].Value.ToString(); fo.txtEmail.Text = dataGridView1[7, dataGridView1.CurrentRow.Index].Value.ToString(); fo.txtWebsite.Text = dataGridView1[8, dataGridView1.CurrentRow.Index].Value.ToString(); fo.ShowDialog(); ShowAllCustomers(); } }
private void btnAddCustomer_Click(object sender, EventArgs e) { frmCustomer fo = new frmCustomer(); fo.strAction = "NEWCUSTOMER"; fo.ShowDialog(); ShowAllCustomers(); }