コード例 #1
0
ファイル: Reader.cs プロジェクト: shobaravi/mikeshewrapper
        private void FillPlantDataIntoDataRow(NovanaTables.IndvindingerRow CurrentRow, JupiterXL.DRWPLANTRow anlaeg, Plant P, DateTime StartDate, DateTime EndDate)
        {
            CurrentRow.PLANTID = anlaeg.PLANTID;
              CurrentRow.PLANTNAME = anlaeg.PLANTNAME;

              //Get additional data about the plant from the dataset
              CurrentRow.NYKOMNR = anlaeg.MUNICIPALITYNO2007;
              CurrentRow.KOMNR = anlaeg.MUNICIPALITYNO;
              CurrentRow.ATYP = anlaeg.PLANTTYPE;
              CurrentRow.ANR = anlaeg.SERIALNO;
              CurrentRow.UNR = anlaeg.SUBNO;
              CurrentRow.ANTUNDERA = P.SubPlants.Count;

              if (anlaeg.IsXUTMNull())
            CurrentRow.ANLUTMX = 0;
              else
            CurrentRow.ANLUTMX = anlaeg.XUTM;

              if (anlaeg.IsYUTMNull())
            CurrentRow.ANLUTMY = 0;
              else
            CurrentRow.ANLUTMY = anlaeg.YUTM;

              CurrentRow.VIRKTYP = anlaeg.COMPANYTYPE;
              CurrentRow.ACTIVE = anlaeg.ACTIVE;

              if (!anlaeg.IsSUPPLANTNull())
            CurrentRow.OVERANL = anlaeg.SUPPLANT;

              var SelectecExtrations = P.Extractions.Where(var => var.Time >= StartDate && var.Time <= EndDate);
              var ActualValue = SelectecExtrations.FirstOrDefault(var => var.Time.Year == EndDate.Year);

              if (P.Extractions.Count > 0)
              {
            if (SelectecExtrations.Count() > 0)
            {
              CurrentRow.MEANINDV = SelectecExtrations.Average(var => var.Value);
              if (ActualValue != null)
            CurrentRow.AKTUELIND = ActualValue.Value;
              else
            CurrentRow.AKTUELIND = 0;
            }
              }
              CurrentRow.ANTINT_A = P.PumpingIntakes.Count;
              CurrentRow.ANTBOR_A = P.PumpingWells.Count;
        }