Example #1
0
            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;
            }
Example #2
0
 public Report(XmlNode xn)
 {
     this.report                    = new EGH01DB.RGEContext.Report(xn.SelectSingleNode(".//ECOForecastX"));
     this.id                        = Helper.GetIntAttribute(xn, "id", 0);
     this.date                      = Helper.GetDateTimeAttribute(xn, "date", DateTime.Now);
     this.pdk_coef                  = Helper.GetFloatAttribute(xn, "pdk_coef", 0.0f);
     this.water_pdk_coef            = Helper.GetFloatAttribute(xn, "water_pdk_coef", 0.0f);
     this.excessgroundconcentration = Helper.GetFloatAttribute(xn, "excessgroundconcentration", 0.0f);
     this.exesswaterconcentration   = Helper.GetFloatAttribute(xn, "exesswaterconcentration", 0.0f);
 }
Example #3
0
        public ActionResult ChoiceForecastResult()
        {
            ViewBag.EGHLayout = "CEQ";
            ActionResult rc = View("Index");

            try
            {
                CEQContext     db      = new CEQContext(this);
                CEQViewContext context = CEQViewContext.HandlerChoiceForecast(db, this.HttpContext.Request.Params);
                if (context != null && context.RegimChoice == CEQViewContext.REGIM_CHOICE.CHOICE)
                {
                    EGH01DB.RGEContext.Report rgereport = new RGEContext.Report();
                    if (EGH01DB.RGEContext.Report.GetById(db, (int)context.idforecat, out rgereport))
                    {
                        context.report = new EGH01DB.CEQContext.Report(db, rgereport);
                        rc             = View("CEQReport", context.report);
                    }
                }
                else if (context != null && context.RegimChoice == CEQViewContext.REGIM_CHOICE.SAVE)
                {
                    rc = View("Index");
                    XmlNode xn = context.report.toXmlNode();
                    EGH01DB.Primitives.Report report = new EGH01DB.Primitives.Report(1000, "Р", DateTime.Now, xn);
                    EGH01DB.Primitives.Report.Create(db, report);
                    int k = 1;

                    //XmlNode xn = fvc.ecoforecastx.CreateReport().toXmlNode();
                    //EGH01DB.Primitives.Report report = new EGH01DB.Primitives.Report(1000, "П", DateTime.Now, xn);
                    //EGH01DB.Primitives.Report.Create(db, report);
                }
                else if (context != null && context.RegimChoice == CEQViewContext.REGIM_CHOICE.CANCEL)
                {
                    rc = View("Index");
                }
                else
                {
                    rc = View(db);
                }
            }
            catch (EGHDBException e)
            {
                rc = View("Index");
            }
            catch (Exception e)
            {
                rc = View("Index");
            }
            return(rc);
        }