private void btnadd_Click(object sender, EventArgs e) { if (txtyear.Text == string.Empty || textBox1.Text == string.Empty || textBox2.Text == string.Empty || textBox5.Text == string.Empty || textBox4.Text == string.Empty || comboday.Text == string.Empty || textBox3.Text == string.Empty || dtpT1.Value.TimeOfDay.Hours >= dtpT2.Value.TimeOfDay.Hours ) { MessageBox.Show(" الرجاء ادخال جميع البييانات مع التاكد من عدم حدوث تضارب فى مواعيد المحاضرة", "اضافة جدول محاضرات جديد", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } BL.CLS_lectures l = new BL.CLS_lectures(); l.UpdateLecTale(this.Id, comboday.Text.ToString(), BL.CLS_Settings.time2String(dtpT1.Value), BL.CLS_Settings.time2String(dtpT2.Value), txtyear.Text, l.GetLevFromLecTable(this.Id), l.GetSemFromLecTable(this.Id), l.GetSubFromLecTable(this.Id), l.GetDeptFromLecTable(this.Id), Convert.ToInt32(comboclass.SelectedValue)); MessageBox.Show("تم تعديل جدول المحاضرة بنجاح", "تعديل جدول المحاضرات ", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnadd_Click(object sender, EventArgs e) { DataTable datatale = lec.VerifiedLecTable(comboday.Text.ToString(), BL.CLS_Settings.time2String(dtpT1.Value), txtyear.Text, Convert.ToInt32(combosubject.SelectedValue), Convert.ToInt32(combodepartment.SelectedValue), Convert.ToInt32(combolevel.SelectedValue), Convert.ToInt32(combosem.SelectedValue), Convert.ToInt32(comboclass.SelectedValue)); if (txtyear.Text == string.Empty || combodepartment.Text == string.Empty || combolevel.Text == string.Empty || combosem.Text == string.Empty || comboinstructor.Text == string.Empty || comboday.Text == string.Empty || combosubject.Text == string.Empty || dtpT1.Value.TimeOfDay.Hours >= dtpT2.Value.TimeOfDay.Hours ) { MessageBox.Show(" الرجاء ادخال جميع البييانات مع التاكد من عدم حدوث تضارب فى مواعيد المحاضرة", "اضافة جدول محاضرات جديد", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else if (datatale.Rows.Count > 0) { MessageBox.Show("هذا اليوم أو الفصل غير فارغ فى هذا التوقيت ", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } BL.CLS_lectures l = new BL.CLS_lectures(); l.add_lectures(comboday.Text.ToString(), BL.CLS_Settings.time2String(dtpT1.Value), BL.CLS_Settings.time2String(dtpT2.Value), txtyear.Text, Convert.ToInt32(combolevel.SelectedValue), Convert.ToInt32(combosem.SelectedValue), Convert.ToInt32(combosubject.SelectedValue), Convert.ToInt32(combodepartment.SelectedValue), Convert.ToInt32(comboclass.SelectedValue)); MessageBox.Show("تم اضافة جدول المحاضرة بنجاح", "اضافة جدول محاضرات جديد", MessageBoxButtons.OK, MessageBoxIcon.Information); txtyear.Clear(); txtyear.Focus(); }