private void yesButtonHandler(NewCourseInfo info) { Model.Course course = hall.courseRef; course.name = info.name; course.id = info.id; course.remark = info.remark; course.getRecord(Record.RType.attendance).weight = info.weight.attendance; course.getRecord(Record.RType.late).weight = info.weight.late; course.getRecord(Record.RType.sickLeave).weight = info.weight.sickLeave; course.getRecord(Record.RType.businessLeave).weight = info.weight.businessLeave; course.getRecord(Record.RType.absenteeism).weight = info.weight.absenteeism; GlobalStation.shareInstance.librarySave(delegate() { hall.updateCourseInfo(course.name, course.id, course.remark); }, null); Close(); }
public static void showForm(CourseHall hall) { CourseHallEditForm form = new CourseHallEditForm(); form.hall = hall; Model.Course course = hall.courseRef; form.editPanel.nameBox.text = course.name; form.editPanel.idBox.text = course.id; form.editPanel.remarkBox.text = course.remark; form.editPanel.attWeight.setSelectedIntValue(course.getRecord(Record.RType.attendance).weight); form.editPanel.lateWeight.setSelectedIntValue(course.getRecord(Record.RType.late).weight); form.editPanel.sickWeight.setSelectedIntValue(course.getRecord(Record.RType.sickLeave).weight); form.editPanel.busWeight.setSelectedIntValue(course.getRecord(Record.RType.businessLeave).weight); form.editPanel.absWeight.setSelectedIntValue(course.getRecord(Record.RType.absenteeism).weight); form.editPanel.resize(null, null); form.ShowDialog(); }
private void setAttandanceToTheStudent(Record.RType type) { Model.Course course = hall.courseRef; StuList stuList = course.getStuList(hall.SelectedStuListUUID); string stuId = hall.getRowValue(hall.mainGrid.CurrentRow.Index, mainGridCellIndex.id); Student stu = stuList[stuId]; StuAttandance stuAtt = stu.getAttandance(newSubAtt.UUID); if (stuAtt == null) { stuAtt = new StuAttandance(newSubAtt, course.getRecord(type)); stu.addAttandance(stuAtt); } else { stuAtt.record = course.getRecord(type); } }
private void changeSpecalAttribute(Model.Course course, StuList stuList, DataGridViewCellEventArgs e) { Student stu = stuList[editingStudentId]; DataGridViewColumn column = mainGrid.Columns[e.ColumnIndex]; string UUID = column.Name; SubAttandance subAtt = course.getSubAttandance(UUID); string value = (string)mainGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; if (subAtt != null) { Record recordToChangeTo = course.getRecord(value); changeAttandance(stu, subAtt, recordToChangeTo); mainGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = recordToChangeTo.recordColor; } else { subExtra subExt = course.getExtra(UUID); changeExtra(stu, subExt, value); mainGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = subExt[value].typeColor; } }