protected override void FillOnePerson(PersonResult result, Worksheet sheet) { Cells cells = sheet.Cells; int maxDataRow = cells.MaxDataRow + 1; cells[maxDataRow, 0].PutValue(result.PersonName); foreach (var dayResult in result.DayResults) { int dayNum = dayResult.DayNum; if (dayResult.Status == ResultStatus.Normal) { SetCellColor(cells, maxDataRow, dayNum, 1, mWorkbook.Styles[NORMAL_COLOR]); } else { //cells[maxDataRow, dayNum].PutValue(GetStatusString(dayResult.Status)); if (IsContain(dayResult.Status, ResultStatus.Late)) { SetCellColor(cells, maxDataRow, dayNum, 1, mWorkbook.Styles[LATE_COLOR]); } else if (IsContain(dayResult.Status, ResultStatus.HR)) { SetCellColor(cells, maxDataRow, dayNum, 1, mWorkbook.Styles[NEED_HR_COLOR]); } } } }
protected override void FillOnePerson(PersonResult result, Worksheet sheet) { Cells cells = sheet.Cells; int maxDataRow = cells.MaxDataRow; int index = 1; foreach (var dayResult in result.DayResults) { DayRecord dayRecord = dayResult.DayRecord; foreach (var dayTime in dayRecord.DayTimes) { cells[maxDataRow + index, 0].PutValue(result.PersonName); cells[maxDataRow + index, 1].PutValue((dayRecord.HighDayTime + dayTime).ToString()); cells[maxDataRow + index, 2].PutValue(GetStatusString(dayResult.Status)); if (IsContain(dayResult.Status, ResultStatus.Late)) { SetCellColor(cells, maxDataRow + index, 0, 3, mWorkbook.Styles[LATE_COLOR]); } else if (IsContain(dayResult.Status, ResultStatus.HR)) { SetCellColor(cells, maxDataRow + index, 0, 3, mWorkbook.Styles[NEED_HR_COLOR]); } index++; } } }
public void CheckRecords(Dictionary <string, PersonRecord> persons) { foreach (var person in persons) { PersonResult checkResult = new PersonResult(); PersonRecord personRecord = person.Value; personRecord.PickWorkStartTime(); checkResult = personRecord.Check() as PersonResult; CheckResults.Add(checkResult); } }
public object Check() { PersonResult result = new PersonResult(this.Name); foreach (var item in DayRecords) { DayRecord day = item.Value; day.SetStandardRecord(this.mWorkStartTime); result.AddResult(day.Check() as DayResult); } return(result); }
protected virtual void FillOnePerson(PersonResult result, Worksheet sheet) { }