Exemplo n.º 1
0
        public void TableMergeTest()
        {
            NovanaTables.IntakeCommonDataTable DT = new NovanaTables.IntakeCommonDataTable();
              NovanaTables.PejlingerDataTable DT2 = new NovanaTables.PejlingerDataTable();

              NovanaTables.IntakeCommonRow dr = DT.NewIntakeCommonRow();
              dr.NOVANAID = "boring 1";
              dr.JUPKOTE = 10;

              DT.Rows.Add(dr);

              NovanaTables.PejlingerRow dr1 = DT2.NewPejlingerRow();
              dr1.NOVANAID= "boring2";
              DT2.Rows.Add(dr1);
              NovanaTables.PejlingerRow dr2 = DT2.NewPejlingerRow();
              dr2.NOVANAID = "boring 1";
              DT2.Rows.Add(dr2);

              int n = dr.Table.Columns.Count;
              DT.Merge(DT2);
              n = dr.Table.Columns.Count;

             dr["AKTDAGE"] = 2;
        }
Exemplo n.º 2
0
        public void AddDataForNovanaPejl(IEnumerable<JupiterIntake> Intakes)
        {
            NovanaTables.PejlingerDataTable DT1 = new NovanaTables.PejlingerDataTable();
              NovanaTables.PejlingerRow CurrentRow;

              NovanaTables.IntakeCommonDataTable DT2 = new NovanaTables.IntakeCommonDataTable();

              foreach (JupiterIntake CurrentIntake in Intakes)
              {
            CurrentIntake.Data = DT2.NewIntakeCommonRow();
            AddCommonDataForNovana(CurrentIntake);
            DT2.Rows.Add(CurrentIntake.Data);
            CurrentRow = DT1.NewPejlingerRow();
            CurrentRow.NOVANAID = CurrentIntake.Data["NOVANAID"].ToString();

            DT1.Rows.Add(CurrentRow);

            //Create statistics on water levels
            CurrentRow.ANTPEJ = CurrentIntake.Observations.Count;
            if (CurrentRow.ANTPEJ > 0)
            {

              CurrentRow.REFPOINT = CurrentIntake.RefPoint;
              CurrentRow.MINDATO = CurrentIntake.Observations.Min(x => x.Time);
              CurrentRow.MAXDATO = CurrentIntake.Observations.Max(x => x.Time);
              CurrentRow.AKTAAR = CurrentRow.MAXDATO.Year - CurrentRow.MINDATO.Year + 1;
              CurrentRow.AKTDAGE = CurrentRow.MAXDATO.Subtract(CurrentRow.MINDATO).Days + 1;
              CurrentRow.PEJPRAAR = CurrentRow.ANTPEJ / CurrentRow.AKTAAR;
              CurrentRow.MAXPEJ = CurrentIntake.Observations.Max(num => num.Value);
              CurrentRow.MINPEJ = CurrentIntake.Observations.Min(num => num.Value);
              CurrentRow.MEANPEJ = CurrentIntake.Observations.Average(num => num.Value);
            }
              }
              //Add a blank string to ensure length of column
              DT2.Rows[0]["Comment"] = "                                                   ";
              DT2.Rows[0]["OK_KOMMENT"] = "                                                   ";

              DT2.Merge(DT1);
        }