Пример #1
0
        private void dgrdvZhzzt_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 4 && Alert.confirm(Const.DEL_CONFIRM_MSG))
            {
                //删除
                if (GIS.Common.DataEditCommon.DeleteFeatureByWhereClause(frmzhzzt.pFeatureClass, "BID='" + dgrdvZhzzt.Rows[e.RowIndex].Cells[2].Value.ToString() + "'"))
                {
                    binddata();
                }
            }
            if (e.ColumnIndex == 5)
            {
                //打开
                string bid     = dgrdvZhzzt.Rows[e.RowIndex].Cells[2].Value.ToString();
                string bilichi = dgrdvZhzzt.Rows[e.RowIndex].Cells[3].Value.ToString();
                List <ESRI.ArcGIS.Geometry.IGeometry> listgeo = new List <ESRI.ArcGIS.Geometry.IGeometry>();
                IQueryFilter pFilter = new QueryFilterClass();
                pFilter.WhereClause = "BID='" + bid + "'";
                IFeatureCursor pCursor  = frmzhzzt.pFeatureClass.Search(pFilter, false);
                IFeature       pFeature = pCursor.NextFeature();
                while (pFeature != null)
                {
                    listgeo.Add(pFeature.Shape);
                    pFeature = pCursor.NextFeature();
                }
                frmzhzzt.pGeometry = MyMapHelp.GetGeoFromGeos(listgeo);
                frmzhzzt.BID       = bid;
                frmzhzzt.blc       = Convert.ToDouble(bilichi);

                DialogResult = DialogResult.OK;
                this.Close();
            }
            if (e.ColumnIndex == 6)
            {
                //修改
                this.Close();
                string      bid = dgrdvZhzzt.Rows[e.RowIndex].Cells[2].Value.ToString();
                FrmNewZHZZT frm = new FrmNewZHZZT(frmzhzzt, bid);
                frm.Show(frmzhzzt);
            }
            if (e.ColumnIndex == 0)
            {
                if (dgrdvZhzzt.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString().ToLower() == "true")
                {
                    dgrdvZhzzt.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = false;
                }
                else
                {
                    dgrdvZhzzt.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = true;
                }
            }
        }
Пример #2
0
        private void tStripBtnNew_Click(object sender, EventArgs e)
        {
            FrmNewZHZZT frm = new FrmNewZHZZT(this);

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                MyMapHelp.Show_IsVisiable(axMapControlZZT.Map, pLayer, "BID='" + BID + "'");
                pGeometry = setgeo(pGeometry);
                axMapControlZZT.Extent   = pGeometry.Envelope;
                axMapControlZZT.MapScale = blc;
                axMapControlZZT.ActiveView.Refresh();
            }
            else
            {
                MyMapHelp.Show_IsVisiable(axMapControlZZT.Map, pLayer, "BID='-1'");
            }
        }