示例#1
0
 private void init_rows_attandanceInit(DataGridViewRow newRow, ArrayList subAtts, Student stu)
 {
     foreach (SubAttandance subAtt in subAtts)
     {
         StuAttandance stuAtt = stu.getAttandance(subAtt.UUID);
         if (stuAtt != null)
         {
             int CellIndex = getColumnIndexByName(subAtt.UUID);
             newRow.Cells[CellIndex].Value = stuAtt.record.recordString();
             Color cellColor = stuAtt.record.recordColor;
             newRow.Cells[CellIndex].Style.BackColor =
                 (cellColor != Color.Empty) ? cellColor : backgroundColor;
         }
     }
 }
示例#2
0
        private void changeAttandance(Student stu, SubAttandance subAtt, Record record)
        {
            StuAttandance stuAtt = stu.getAttandance(subAtt.UUID);

            if (stuAtt == null)
            {
                stuAtt = new StuAttandance(subAtt, record);
                stu.addAttandance(stuAtt);
            }
            else
            {
                stuAtt.date   = subAtt.date;
                stuAtt.UUID   = subAtt.UUID;
                stuAtt.record = record;
            }
        }
        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);
            }
        }