Exemplo n.º 1
0
        /// <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);
                }
            }
        }
Exemplo n.º 2
0
 public void AddResultSummaryToDb(ResultSummary item)
 {
     ResultSummaries.Add(item);
 }
Exemplo n.º 3
0
 public ResultSummary AddResultSummary(ResultSummary arg)
 {
     arg.C_RowId = ++_rowCounter;
     ResultSummaries.Add(arg);
     return(arg);
 }