Ejemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (lstSemester.Items.Count >= 8)
     {
         MessageBox.Show("Học kỳ từ 1 đến 8.", Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtSemester.Focus();
         txtSemester.SelectAll();
         return;
     }
     else
     {
         try
         {
             ObjCourseDetails.Semester = txtSemester.Text;
             ObjCourseDetails.AddSemester();
             MessageBox.Show("Lưu thành công.", Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
             Process();
         }
         catch (SqlException ex)
         {
             MessageBox.Show(ex.Message, Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Ejemplo n.º 2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (lstSemester.Items.Count >= 8)
     {
         MessageBox.Show("Semester must be between 1 to 8 accept.", Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtSemester.Focus();
         txtSemester.SelectAll();
         return;
     }
     else
     {
         try
         {
             ObjCourseDetails.Semester = txtSemester.Text;
             ObjCourseDetails.AddSemester();
             MessageBox.Show("Saved Successfully.", Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
             Process();
         }
         catch (SqlException ex)
         {
             MessageBox.Show(ex.Message, Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }