Exemple #1
0
        public DeficientResult GetData(SimulationModel data, int[] totalYears)
        {
            // Deficient and DeficientResults are models. Deficient gets data
            // from the database. DeficientResult gets the processed data
            IQueryable <DeficientReportModel> deficients = null;
            DeficientResult result = null;

            var select =
                "SELECT TargetID, Years, TargetMet, IsDeficient " +
                " FROM Target_" + data.NetworkId
                + "_" + data.SimulationId;

            try
            {
                var rawDeficientList = db.Database.SqlQuery <DeficientReportModel>(select).AsQueryable();

                deficients = rawDeficientList.Where(_ => _.IsDeficient == true);

                var targetAndYear = this.deficients.GetData(deficients);
                result = GetDeficientInformation(data, targetAndYear, totalYears);
            }
            catch (SqlException ex)
            {
                HandleException.SqlError(ex, "Target");
            }
            catch (OutOfMemoryException ex)
            {
                HandleException.OutOfMemoryError(ex);
            }
            catch (Exception ex)
            {
                HandleException.GeneralError(ex);
            }
            return(result);
        }
Exemple #2
0
 public DeficientReportDAL(BridgeCareContext context, TargetsMetDAL deficient, CellAddress cell)
 {
     db         = context ?? throw new ArgumentNullException(nameof(context));
     deficients = deficient ?? throw new ArgumentNullException(nameof(deficient));
     address    = cell ?? throw new ArgumentNullException(nameof(cell));
 }
Exemple #3
0
 public TargetsDAL(TargetsMetDAL targetsMetDAL, TargetResultsDAL targetCells)
 {
     this.targetsMetDAL = targetsMetDAL ?? throw new ArgumentNullException(nameof(targetsMetDAL));
     this.targetCells   = targetCells ?? throw new ArgumentNullException(nameof(targetCells));
 }