private void btnAddSource_Click(object sender, EventArgs e) { try { sourceControl = new SourceControl(); if (txtSourceName.Text == "") { MessageBox.Show("!خطأ لم يتم إدخال اسم المكتب", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Boolean check = false; string name = txtSourceName.Text; string address = txtSourceAddress.Text; string EmployeeName1 = txtSourceEmployee1.Text; string EmployeeName2 = txtSourceEmployee2.Text; setZero(); string phone1 = txtSourcePhone1.Text; string phone2 = txtSourcePhone2.Text; string phone3 = txtSourcePhone3.Text; check = sourceControl.insertSource(name, address, EmployeeName1, EmployeeName2, phone1, phone2, phone3); if (check == false) { MessageBox.Show("!لقد تم إضافة هذا المكتب من قبل ", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("تمت إضافةالمكتب بنجاح", "تم", MessageBoxButtons.OK, MessageBoxIcon.Information); txtSourceName.Text = ""; txtSourceAddress.Text = ""; txtSourceEmployee1.Text = ""; txtSourceEmployee2.Text = ""; txtSourcePhone1.Text = ""; txtSourcePhone2.Text = ""; txtSourcePhone3.Text = ""; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }