private void tabBtnMenuMethod_ChangeName(string uuid, string name) { Model.Course course = courseRef; StuList stuList = course.getStuList(uuid); string originName = stuList.name; stuList.name = name; GlobalStation.shareInstance.librarySave(null, delegate() { stuList.name = originName; }); initTabsContent(); }
private void MainGrid_CellValueChanged(object sender, DataGridViewCellEventArgs e) { Model.Course course = courseRef; StuList stuList = course.getStuList(SelectedStuListUUID); if (e.ColumnIndex < (int)mainGridCellIndex.subAttStartIndex) { mainGridCellIndex index = (mainGridCellIndex)e.ColumnIndex; string value = getRowValue(e.RowIndex, index); changeBaseAttribute(stuList, index, value); } else { changeSpecalAttribute(course, stuList, e); } saveChange(); }
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 deleteStudent(int rowIndex) { StuList stuList = null; Student stu = null; string studentId = getRowValue(rowIndex, mainGridCellIndex.id); Model.Course course = courseRef; string stuListId = SelectedStuListUUID; stuList = course.getStuList(stuListId); stu = stuList[studentId]; stuList.removeStudent(studentId); GlobalStation.shareInstance.librarySave(delegate() { mainGrid.Rows.Remove(mainGrid.Rows[rowIndex]); }, delegate() { stuList.addStudent(stu); }); }
private void DIY() { string newStuIdString; string major, grade, _class; Model.Course course = courseRef; string selectedStuListId = SelectedStuListUUID; StuList stuList = course.getStuList(selectedStuListId); newStuIdString = DIY_calTheMaxStudentId(stuList); DIY_getMajorInfoOfLastStudent(stuList, out major, out grade, out _class); Student stu = DIY_createNewStudent(newStuIdString, major, grade, _class); stuList.addStudent(stu); GlobalStation.shareInstance.librarySave(null, delegate() { stuList.removeStudent(stu.id); }); maingrid_addRow(stu); }
public void initTableViewContent() { mainGridCurrentScrollPosition = mainGrid.HorizontalScrollingOffset; if (mainGrid.CurrentRow != null) { mainGridCurrentRowIndex = mainGrid.CurrentRow.Index; } clearContent(); Model.Course course = courseRef; init_subAttandanceColumn(course); init_subExtraColumn(course); string StuListUUID = SelectedStuListUUID; StuList stuList = course.getStuList(StuListUUID); if (stuList != null) { init_rows(course, stuList); } startCellValueChanged(); mainGrid.HorizontalScrollingOffset = mainGridCurrentScrollPosition; setSeletedRow(mainGridCurrentRowIndex); }