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; } BusinessRuler.Subject objSubject = new BusinessRuler.Subject(this.dgvDetails); objSubject.Delete(); }
private void tvwMain_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { this.dgvDetails.Visible = true; this.lvwMain.Visible = false; if (e.Node.Text.Equals("班级管理")) { SetDataGirdStyleForClass(); BusinessRuler.Classes objClass = new Classes(this.dgvDetails); objClass.UpdateDataGrid(); } else if (e.Node.Text.Equals("科目管理")) { SetDataGridStyleForSubject(); BusinessRuler.Subject objSubject = new BusinessRuler.Subject(this.dgvDetails); objSubject.UpdateDataGrid(); } else if (e.Node.Text.Equals("主界面")) { tbrReturnMain_Click(sender, e); } if (e.Node.Parent != null) { if (e.Node.Parent.Text.Equals("学生管理")) { SetDataGridStyleForStudent(); BusinessRuler.Student objStudent = new Student(this.dgvDetails, e.Node.Text); objStudent.UpdateDataGrid(); } else if (e.Node.Parent.Text.Equals("课程管理")) { SetDataGridStyleForCourse(); BusinessRuler.Course objCourse = new Course(this.dgvDetails, e.Node.Text); objCourse.UpdateDataGrid(); } else if (e.Node.Parent.Text.Equals("成绩管理")) { SetDataGridStyleForScore(); BusinessRuler.Score objScore = new Score(this.dgvDetails, e.Node.Text); objScore.UpdateDataGrid(); } this._currentClassName = e.Node.Text; } }
private void FrmSubject_Load(object sender, EventArgs e) { BusinessRuler.Subject objSubject = new BusinessRuler.Subject(this.dgvDetails); objSubject.UpdateDataGrid(); }