private void cmuDelete_Click(object sender, EventArgs e)
 {
     if (!CheckCondition())
     {
         return;
     }
     if (this.Tag.Equals("Class"))
     {
         BusinessRuler.Classes objClass = new BusinessRuler.Classes(this.dgvDetails);
         objClass.DeleteClass(this.dgvDetails.CurrentRow.Cells[0].Value.ToString());
     }
     else if (this.Tag.Equals("Student"))
     {
         int    studentNo   = (Int32.Parse(this.dgvDetails.CurrentRow.Cells[0].Value.ToString()));
         string studentName = this.dgvDetails.CurrentRow.Cells[1].Value.ToString();
         BusinessRuler.Student objStudent = new BusinessRuler.Student(this.dgvDetails, _currentClassName);
         objStudent.Delete(studentNo, studentName, _currentClassName);
     }
     else if (this.Tag.Equals("Subject"))
     {
         BusinessRuler.Subject objSubject = new BusinessRuler.Subject(this.dgvDetails);
         objSubject.Delete();
     }
     else if (this.Tag.Equals("Course"))
     {
         BusinessRuler.Course objCourse = new BusinessRuler.Course(this.dgvDetails, _currentClassName);
         objCourse.Delete();
     }
     else if (this.Tag.Equals("Score"))
     {
         BusinessRuler.Score objScore = new BusinessRuler.Score(this.dgvDetails, _currentClassName);
         objScore.Delete();
     }
 }
Esempio n. 2
0
 private void trbDelete_Click(object sender, EventArgs e)
 {
     if (!CheckCondition())
     {
         return;
     }
     BusinessRuler.Subject objSubject = new BusinessRuler.Subject(this.dgvDetails);
     objSubject.Delete();
 }