Exemplo n.º 1
0
        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;
            }
        }