示例#1
0
        private void AddLocationButt_Click(object sender, EventArgs e)
        {
            if (Convert.ToSingle(locationGrid.Rows[0].Cells[0].Value) < 73 ||
                Convert.ToSingle(locationGrid.Rows[0].Cells[0].Value) > 135 ||
                Convert.ToSingle(locationGrid.Rows[0].Cells[1].Value) > 53 ||
                Convert.ToSingle(locationGrid.Rows[0].Cells[1].Value) < 23)
            {
                MessageBox.Show("经纬度输入越界,请重新输入!");
                return;
            }

            GdpDrive Gdp = new GdpDrive();

            Gdp.AddPointFeature("site", Convert.ToSingle(locationGrid.Rows[0].Cells[0].Value), Convert.ToSingle(locationGrid.Rows[0].Cells[1].Value));
            List <string> fields = new List <string>();

            fields.Add("Name");
            List <dynamic> datas = new List <dynamic>();

            datas.Add(Convert.ToString(locationGrid.Rows[0].Cells[2].Value));
            Gdp.ChangeTableRecord("site", "Name", null, fields, datas);
            axMapControl_Main.ActiveView.Refresh();
            MessageBox.Show("添加成功");
        }