Beispiel #1
0
 public FormNearly()
 {
     InitializeComponent();
     this.m_pFeatureLayer = AeUtils.GetFeatureLayerByName("Students");
     this.m_pPointList    = new List <IPoint>();
     this.TopMost         = true;
 }
Beispiel #2
0
        private void FormHawkEye_Load(object sender, EventArgs e)
        {
            axMapControl_HawkEye.AutoKeyboardScrolling = false;
            axMapControl_HawkEye.AutoMouseWheel        = false;
            this.TopMost = true;

            CopyMainLayersToHawkEye();
            AeUtils.DrawRectangle(m_pMapC2_HawkEye, m_pMapC2_Main.Extent);
        }
Beispiel #3
0
        private void ShowLabel()
        {
            int index = comboBox_field.SelectedIndex;

            if (!checkBox_OpenClose.Checked)
            {
                index = -1;
            }
            AeUtils.ShowLabel(m_pFeatureLayer, index);
        }
Beispiel #4
0
        public override void OnClick()
        {
            IFeatureLayer   pFeatureLayer = (m_pMapC2 as IMapControl4).CustomProperty as IFeatureLayer;
            ISimpleRenderer pRenderer     = new SimpleRendererClass()
            {
                Symbol = AeUtils.GetSymbolBySymbolSelector(pFeatureLayer.FeatureClass.ShapeType)
            };

            (pFeatureLayer as IGeoFeatureLayer).Renderer = pRenderer as IFeatureRenderer;
            m_pMapC2.Refresh();
            AeUtils.UpdateTOCControl();
        }
Beispiel #5
0
        private void FormNearly_Load(object sender, EventArgs e)
        {
            IFeatureCursor pFeatureCursor = m_pFeatureLayer.FeatureClass.Search(null, false);
            IFeature       pFeature       = pFeatureCursor.NextFeature();

            while (pFeature != null)
            {
                IPoint pPoint = pFeature.Shape as IPoint;
                pPoint.ID = (int)pFeature.get_Value(0);
                pPoint.Project(AeUtils.GetMapSpatialReference());
                m_pPointList.Add(pPoint);
                cbx_TargetStudent.Items.Add(pFeature.get_Value(pFeature.Fields.FindField("SNAME")).ToString());
                pFeature = pFeatureCursor.NextFeature();
            }
        }
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            if (cbx_SSex.SelectedIndex == -1)
            {
                MessageBox.Show("学生信息未填写完成!", "无法添加学生信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            string strSID    = tbx_SId.Text,
                   strSNAME  = tbx_SName.Text,
                   strSSEX   = cbx_SSex.SelectedItem.ToString(),
                   strSBIRTH = dtime_SBirth.Value.ToShortDateString(),
                   strSHOME  = tbx_Home.Text;

            if (strSID == "" || strSNAME == "" || strSSEX == "" || strSBIRTH == "" || strSHOME == "")
            {
                MessageBox.Show("学生信息未填写完成!", "无法添加学生信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (m_pIsAdd)
            {
                if (SqlUtils.AddStudent(strSID, strSNAME, strSSEX, strSBIRTH, strSHOME))
                {
                    string id = SqlUtils.GetIdFromSId(strSID);
                    AeUtils.AddStudent(m_pPoint, id, strSID, strSNAME, strSSEX, strSBIRTH, strSHOME);
                    MessageBox.Show(String.Format("学生【{0}】添加成功", strSNAME));
                    UpdataDatabaseView();
                    this.Close();
                }
            }
            else
            {
                if (SqlUtils.EditStudent(m_pId, strSID, strSNAME, strSSEX, strSBIRTH, strSHOME))
                {
                    AeUtils.EditStudent(this.m_pPoint, m_pId, strSID, strSNAME, strSSEX, strSBIRTH, strSHOME);
                    MessageBox.Show(String.Format("学生【Id:{0}】信息修改成功", m_pId));
                    UpdataDatabaseView();
                    this.Close();
                }
            }
        }
 private void btn_GetLocation_Click(object sender, EventArgs e)
 {
     m_pIsGettingPoint = true;
     this.WindowState  = FormWindowState.Minimized;
     AeUtils.SetMousePointer(esriControlsMousePointer.esriPointerCrosshair);
 }
 private void FormEditStudent_FormClosed(object sender, FormClosedEventArgs e)
 {
     AeUtils.DeleteAllMapElement();
 }
 private void btn_Cancel_Click(object sender, EventArgs e)
 {
     AeUtils.DeleteAllMapElement();
     this.Close();
 }
Beispiel #10
0
 private void ShowResultInMap(IPoint targetPoint, IPoint pPoint)
 {
     AeUtils.DrawLine(targetPoint, pPoint);
 }
Beispiel #11
0
 public void DrawExtent()
 {
     AeUtils.DrawRectangle(m_pMapC2_HawkEye, m_pMapC2_Main.Extent);
 }