private NewCourseInfo produceNewCourseInfo() { NewCourseInfo info = new NewCourseInfo(); setInfoBase(ref info); setInfoWeight(ref info); return(info); }
private void setInfoWeight(ref NewCourseInfo info) { NewWeight newWeight = new NewWeight(); newWeight.attendance = attWeight.getSelectedIntValue(); newWeight.late = lateWeight.getSelectedIntValue(); newWeight.absenteeism = absWeight.getSelectedIntValue(); newWeight.sickLeave = sickWeight.getSelectedIntValue(); newWeight.businessLeave = busWeight.getSelectedIntValue(); info.weight = newWeight; }
private void yesButton_Click(object sender, EventArgs e) { if (isFieldsReady() && yes != null) { NewCourseInfo courseInfo = produceNewCourseInfo(); yes(courseInfo); } else { HKConfirmForm.showConfirmForm("信息未填写完整"); } }
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(); }
private void setInfoBase(ref NewCourseInfo info) { info.name = nameBox.textBox.Text; info.id = idBox.textBox.Text; info.remark = remarkBox.text; }