private void btnUpdateSource_Click(object sender, EventArgs e) { try { if (comboBoxSorceName.Text == "") { MessageBox.Show("من فضلك اختر المكتب", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (txtSourceName.Text == "") { MessageBox.Show("من فضلك ادخل اسم المكتب", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { sourceControl = new SourceControl(); string previousName = comboBoxSorceName.Text; string sourceName = txtSourceName.Text; string address = txtSourceAddress.Text; string employee1 = txtSourceEmployee1.Text; string employee2 = txtSourceEmployee2.Text; string phone1 = txtSourcePhone1.Text; string phone2 = txtSourcePhone2.Text; string phone3 = txtSourcePhone3.Text; sourceControl.updateSource(previousName, sourceName, address, employee1, employee2, phone1, phone2, phone3); MessageBox.Show("تم تعديل البيانات بنجاح", "تم", MessageBoxButtons.OK, MessageBoxIcon.Information); txtSourceName.Text = ""; txtSourceAddress.Text = ""; txtSourceEmployee1.Text = ""; txtSourceEmployee2.Text = ""; txtSourcePhone1.Text = ""; txtSourcePhone2.Text = ""; txtSourcePhone3.Text = ""; sourceControl.fillComboboxSourceName(comboBoxSorceName); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }