private void WriteNovanaShape(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { JupiterReader.AddDataForNovanaPejl(listBoxIntakes.Items.Cast <JupiterIntake>()); HeadObservations.WriteShapeFromDataRow(saveFileDialog1.FileName, listBoxIntakes.Items.Cast <JupiterIntake>()); } }
private void button3_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { IEnumerable <Plant> plants = listBoxAnlaeg.Items.Cast <Plant>(); IEnumerable <JupiterIntake> intakes = JupiterReader.AddDataForNovanaExtraction(plants, dateTimeStartExt.Value, dateTimeEndExt.Value); HeadObservations.WriteShapeFromDataRow(saveFileDialog1.FileName, intakes); IEnumerable <Plant> PlantWithoutIntakes = plants.Where(var => var.PumpingIntakes.Count == 0); if (PlantWithoutIntakes.Count() > 0) { if (DialogResult.Yes == MessageBox.Show("The list contains plants with no intakes attached. Should these be written to a new shape-file?", "Plants without intakes!", MessageBoxButtons.YesNo)) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { NovanaTables.IndvindingerDataTable dt = JupiterReader.FillPlantData(PlantWithoutIntakes, dateTimeStartExt.Value, dateTimeEndExt.Value); ShapeWriter PSW = new ShapeWriter(saveFileDialog1.FileName); PSW.WritePointShape(dt, dt.ANLUTMXColumn.ColumnName, dt.ANLUTMYColumn.ColumnName); PSW.Dispose(); } } } } }