public Report(CEQContext db, RGEContext.Report report) { CadastreType _cadastretype = CadastreType.defaulttype; RiskObject _riskobject = RiskObject.defaulttype; this.report = report; this.pdk_coef = _cadastretype.pdk_coef; this.water_pdk_coef = _cadastretype.water_pdk_coef; if (report.riskobject_id > 0) { if (RiskObject.GetById(db, report.riskobject_id, ref _riskobject)) { if (_riskobject.cadastretype.pdk_coef > 0) { this.pdk_coef = _riskobject.cadastretype.pdk_coef; } if (_riskobject.cadastretype.water_pdk_coef > 0) { this.water_pdk_coef = _riskobject.cadastretype.water_pdk_coef; } } } this.excessgroundconcentration = this.report.C3 / (this.pdk_coef); this.exesswaterconcentration = this.report.C4 / this.water_pdk_coef; }
public ECOEvalution(RGEContext.ECOForecast forecast) : base(forecast) { CEQContext db = new CEQContext(); // заглушка, выставить правильный контекст //blinova //if (this.groundblur.spreadpoint.cadastretype.pdk_coef <= 0) //throw new EGHDBException(string.Format(errormssageformat, "Значение предельно-дупустимой концентрации не может быть меньше или равно нулю")); this.date = DateTime.Now; if (this.groundblur.spreadpoint.cadastretype.pdk_coef > 0) { this.excessgroundconcentration = this.groundblur.concentrationinsoil / this.groundblur.spreadpoint.cadastretype.pdk_coef; } else { this.excessgroundconcentration = 0.0f; } if (this.groundblur.spreadpoint.cadastretype.water_pdk_coef > 0) { this.exesswaterconcentration = this.groundblur.maxconcentrationwater / this.groundblur.spreadpoint.cadastretype.water_pdk_coef; } else { this.exesswaterconcentration = 0.0f; } this.groundpollutionlist = new GroundPollutionList(this.groundblur.groundpolutionlist.Where(p => p.pointtype == Points.Point.POINTTYPE.ECO).ToList()); this.waterpolutionlist = new WaterPollutionList(); foreach (WaterPollution p in this.waterblur.watepollutionlist) { if (p.distance > this.groundblur.radius && p.distance < this.waterblur.radius) { this.waterpolutionlist.Add(p); } } }