Exemplo n.º 1
0
        public DataTable Data(GazetteerColumnHeaders gazetteerColumnHeaders)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add(gazetteerColumnHeaders.Level1Name);
            dt.Columns.Add(gazetteerColumnHeaders.Level2Name);
            dt.Columns.Add(gazetteerColumnHeaders.Level3Name);
            dt.Columns.Add(gazetteerColumnHeaders.Level1Code);
            dt.Columns.Add(gazetteerColumnHeaders.Level2Code);
            dt.Columns.Add(gazetteerColumnHeaders.Level3Code);

            foreach (var line in lines)
            {
                object[] values =
                {
                    line.Item1[0], line.Item1[1], line.Item1[2],
                    line.Item2[0], line.Item2[1], line.Item2[2]
                };
                dt.LoadDataRow(values, true);
            }
            return dt;
        }
        private void SetColumnNames()
        {
            GazetteerColumnHeaders columnHeaders = new GazetteerColumnHeaders();
            columnHeaders.Level1Code = cboLevel1Codes.SelectedValue as string;
            columnHeaders.Level1Name = cboLevel1Names.SelectedValue as string;
            columnHeaders.Level1AltName = cboLevel1AltNames.SelectedValue as string;

            columnHeaders.Level2Code = cboLevel2Codes.SelectedValue as string;
            columnHeaders.Level2Name = cboLevel2Names.SelectedValue as string;
            columnHeaders.Level2AltName = cboLevel2AltNames.SelectedValue as string;

            columnHeaders.Level3Code = cboLevel3Codes.SelectedValue as string;
            columnHeaders.Level3Name = cboLevel3Names.SelectedValue as string;
            columnHeaders.Level3AltName = cboLevel3AltNames.SelectedValue as string;
            geoCoder.SetGazetteerColumns(columnHeaders);
        }
 private static GazetteerColumnHeaders GazetteerColumnNames()
 {
     GazetteerColumnHeaders gazetteerColumnHeaders = new GazetteerColumnHeaders();
     gazetteerColumnHeaders.Level1Code = "ID1";
     gazetteerColumnHeaders.Level2Code = "ID2";
     gazetteerColumnHeaders.Level3Code = "ID3";
     gazetteerColumnHeaders.Level1Name = "Name1";
     gazetteerColumnHeaders.Level2Name = "Name2";
     gazetteerColumnHeaders.Level3Name = "Name3";
     return gazetteerColumnHeaders;
 }