private void btnAddCustomer_Click(object sender, EventArgs e) { try { string NameCustomerGroup = lueCustomerGroup.Text; string NameCompany = lueCompany.Text; if (NameCompany.Equals("--- Chọn lựa ---") || NameCompany.Equals("")) { lueCompany.Text = "--- Chọn lựa ---"; MessageBox.Show("Vui lòng chọn tên công ty .", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (NameCustomerGroup.Equals("--- Chọn lựa ---") || NameCustomerGroup.Equals("")) { lueCustomerGroup.Text = "--- Chọn lựa ---"; MessageBox.Show("Vui lòng chọn tên nhóm .", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { int IDCustomerGroup = Convert.ToInt32(lueCustomerGroup.EditValue.ToString()); frmIns_CustomerGroups_Customers afrmIns_CustomerGroups_Customers = new frmIns_CustomerGroups_Customers(this, IDCustomerGroup, NameCustomerGroup, NameCompany); afrmIns_CustomerGroups_Customers.ShowDialog(); } } catch (Exception ex) { MessageBox.Show("frmTsk_UpdBooking.btnAddCustomer_Click\n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { frmIns_CustomerGroups_Customers afrmIns_CustomerGroups_Customers = new frmIns_CustomerGroups_Customers(); afrmIns_CustomerGroups_Customers.ShowDialog(); }