private void changeExtra(Student stu, subExtra subExt, string value) { StuExtra stuExt = stu.getStuExtra(subExt.UUID); if (stuExt == null) { stuExt = new StuExtra(subExt, value); stu.addStuExtra(stuExt); } else { stuExt.name = subExt.name; stuExt.result = subExt[value]; } }
private void init_rows_extrasInit(DataGridViewRow newRow, ArrayList extras, Student stu) { foreach (subExtra subExt in extras) { StuExtra stuExt = stu.getStuExtra(subExt.UUID); if (stuExt != null) { int cellIndex = getColumnIndexByName(subExt.UUID); newRow.Cells[cellIndex].Value = stuExt.result.typeName; Color cellColor = stuExt.result.typeColor; newRow.Cells[cellIndex].Style.BackColor = (cellColor != Color.Empty) ? cellColor : backgroundColor; } } }