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 cmuAdd_Click(object sender, EventArgs e) { if (this.Tag.Equals("Class")) { FrmAddClass frmAddClass = new FrmAddClass(dgvDetails); frmAddClass.ShowDialog(); } else if (this.Tag.Equals("Student")) { if (BusinessRuler.Classes.isInCapacity(_currentClassName)) { FrmAddStudent frmAddStudent = new FrmAddStudent(dgvDetails, _currentClassName); frmAddStudent.ShowDialog(); } } else if (this.Tag.Equals("Subject")) { FrmAddSubject frmAddSubject = new FrmAddSubject(this.dgvDetails); frmAddSubject.ShowDialog(); } else if (this.Tag.Equals("Course")) { FrmAddCourse frmAddCourse = new FrmAddCourse(dgvDetails, _currentClassName); frmAddCourse.ShowDialog(); } else if (this.Tag.Equals("Score")) { BusinessRuler.Classes objClass = new BusinessRuler.Classes(); if (objClass.IsStudentExists(_currentClassName) && objClass.IsCourseExist(_currentClassName)) { FrmAddScore frmAddScore = new FrmAddScore(dgvDetails, _currentClassName); frmAddScore.ShowDialog(); } } }
private void trbDeleteClass_Click(object sender, EventArgs e) { if (!CheckCondition()) { return; } BusinessRuler.Classes objClass = new BusinessRuler.Classes(this.dgvDetails); objClass.DeleteClass(this.dgvDetails.CurrentRow.Cells[0].Value.ToString()); }
private void FrmClass_Load(object sender, EventArgs e) { BusinessRuler.Classes objClass = new BusinessRuler.Classes(this.dgvDetails); objClass.UpdateDataGrid(); }