/// <summary> /// Load the Calc and Final summaries /// </summary> public void PrepareResultSummaries() { if (ResultSummaryCalc != null && ResultSummaryFinal != null) { return; } // check each on on its own if (ResultSummaryCalc == null) { ResultSummaryCalc = ResultSummaries.FirstOrDefault(rs => rs.ResultType == ResultType.Calculated); if (ResultSummaryCalc == null) { ResultSummaryCalc = new ResultSummary { ElectionGuid = TargetElection.ElectionGuid, ResultType = ResultType.Calculated }; Savers.ResultSummarySaver(DbAction.Add, ResultSummaryCalc); ResultSummaries.Add(ResultSummaryCalc); } } if (ResultSummaryFinal == null) { ResultSummaryFinal = ResultSummaries.FirstOrDefault(rs => rs.ResultType == ResultType.Final); if (ResultSummaryFinal == null) { ResultSummaryFinal = new ResultSummary { ElectionGuid = TargetElection.ElectionGuid, ResultType = ResultType.Final }; Savers.ResultSummarySaver(DbAction.Add, ResultSummaryFinal); ResultSummaries.Add(ResultSummaryFinal); } } }
public void AddResultSummaryToDb(ResultSummary item) { ResultSummaries.Add(item); }
public ResultSummary AddResultSummary(ResultSummary arg) { arg.C_RowId = ++_rowCounter; ResultSummaries.Add(arg); return(arg); }