Пример #1
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult Result;
         Result = MessageBox.Show("Are you sure you want delete record?", Global.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (Result == DialogResult.Yes)
         {
             objCourseDetails.SubjectCode = SubjectId;
             objCourseDetails.DeleteSubject();
             MessageBox.Show("Delete Successfully.", Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
             ClearAll();
             dataSubjectDetails.Rows.Clear();
             BindData();
             this.btnSave.Text      = "&Save";
             this.btnDelete.Enabled = false;
         }
     }
     catch (Exception Ex)
     {
         MessageBox.Show(Ex.Message, Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult Result;
         Result = MessageBox.Show("Bạn chắc chắn muốn xóa?", Global.Caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (Result == DialogResult.Yes)
         {
             objCourseDetails.SubjectCode = SubjectId;
             objCourseDetails.DeleteSubject();
             MessageBox.Show("Xóa thành công.", Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
             ClearAll();
             dataSubjectDetails.Rows.Clear();
             BindData();
             this.btnSave.Text      = "&Lưu";
             this.btnDelete.Enabled = false;
         }
     }
     catch (Exception Ex)
     {
         MessageBox.Show(Ex.Message, Global.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }