private void BtnShowCountries_Click(object sender, EventArgs e) { DataSet dsCountries = new DataSet(); SxGeo.OpenDB(); //нет справочника стран if (SxGeo.GetHeader().CountrySize == 0) { SxGeo.CloseDB(); MessageBox.Show("No countries data!"); return; } SxGToDataSet toDS = new SxGToDataSet(dsCountries, SxGeo); string CountryFormat = SxGeo.GetHeader().PackFormat. Split('\0')[0]; toDS.CreateTable("Countries", CountryFormat, SxGeoDirType.Countries); if (!toDS.FillTable()) { MessageBox.Show(toDS.ErrorMessage); return; } frmTable fTableCountry = new frmTable(); fTableCountry.TableName = "Countries"; fTableCountry.dsTable = dsCountries; fTableCountry.RecordsCount = toDS.RecordsCount; fTableCountry.ShowDialog(); SxGeo.CloseDB(); }
private void btnShowRegions_Click(object sender, EventArgs e) { DataSet dsRegions = new DataSet(); SxGeo.OpenDB(); //нет справочника регионов if (SxGeo.GetHeader().RegionSize == 0) { SxGeo.CloseDB(); MessageBox.Show("No regions data!"); return; } SxGToDataSet toDS = new SxGToDataSet(dsRegions, SxGeo); string RegionFormat = SxGeo.GetHeader().PackFormat. Split('\0')[1]; toDS.CreateTable("Regions", RegionFormat, SxGeoDirType.Regions); if (!toDS.FillTable()) { MessageBox.Show(toDS.ErrorMessage); return; } frmTable fTableRegion = new frmTable(); fTableRegion.TableName = "Regions"; fTableRegion.dsTable = dsRegions; fTableRegion.RecordsCount = toDS.RecordsCount; fTableRegion.ShowDialog(); SxGeo.CloseDB(); }