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(); } }
private void trbDelete_Click(object sender, EventArgs e) { if (!CheckCondition()) { return; } 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, _className); objStudent.Delete(studentNo, studentName, _className); }
private void FrmStudent_Load(object sender, EventArgs e) { BusinessRuler.Student objStudent = new BusinessRuler.Student(this.dgvDetails, this._className); objStudent.UpdateDataGrid(); }