Esempio n. 1
0
 public int Delete(ImportantLandmarkList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Delete(entityToInsert));
     }
 }
Esempio n. 2
0
 public Guid Insert(ImportantLandmarkList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Insert <Guid>(entityToInsert));
     }
 }
Esempio n. 3
0
 public void ImportantLandmarkData(ImportantLandmarkList _tmpData)
 {
     txtname.Text        = _tmpData.Name;
     txtlon.Text         = _tmpData.Lon.ToString();
     txtlat.Text         = _tmpData.Lat.ToString();
     txtalt.Text         = _tmpData.Alt.ToString();
     txtdescription.Text = _tmpData.Description;
 }
Esempio n. 4
0
        private void ToolStripMenuItem_add_Click(object sender, EventArgs e)
        {
            ImportantLandmarkList        tmpData = null;
            Add_Modify_ImportantLandmark tmpAdd_Modify_ImportantLandmark = new Add_Modify_ImportantLandmark(tmpData);

            tmpAdd_Modify_ImportantLandmark.ShowDialog();
            if (tmpAdd_Modify_ImportantLandmark.result == DialogResult.OK)
            {
                GetImportantLandmarkList();
            }
        }
Esempio n. 5
0
 public Add_Modify_ImportantLandmark(ImportantLandmarkList _tmpData)
 {
     InitializeComponent();
     if (_tmpData == null)
     {
         //TypeNameDataBinding();
     }
     else if (_tmpData != null)
     {
         tmpStation = _tmpData;
         //TypeNameDataBinding();
         ImportantLandmarkData(tmpStation);
     }
 }
Esempio n. 6
0
        private void ToolStripMenuItem_edittype_Click(object sender, EventArgs e)
        {
            ImportantLandmarkList tmpData = new ImportantLandmarkList();

            for (int i = 0; i < tmpListImportantLandmark.Count; i++)
            {
                if (tmpListImportantLandmark[i].ID == _ImportantLandmarkList.ID)
                {
                    tmpData = tmpListImportantLandmark[i];
                    break;
                }
            }
            Add_Modify_ImportantLandmark tmpAdd_Modify_ImportantLandmark = new Add_Modify_ImportantLandmark(tmpData);

            tmpAdd_Modify_ImportantLandmark.ShowDialog();
            if (tmpAdd_Modify_ImportantLandmark.result == DialogResult.OK)
            {
                GetImportantLandmarkList();
            }
        }
Esempio n. 7
0
        private void btnsure_Click(object sender, EventArgs e)
        {
            double lon = 0.0, lat = 0.0, alt = 0.0;

            List <ImportantLandmarkList> tmpImportantLandmarkList = new List <ImportantLandmarkList>();
            ImportantLandmarkList        _ImportantLandmarkList = new ImportantLandmarkList();
            ImportantLandmark_Command    tmpImportantLandmark_Command = new ImportantLandmark_Command();

            if (txtname.Text.Trim() == "")
            {
                MessageBox.Show("请填写设备名字"); return;
            }

            if (txtlon.Text.Trim() == "")
            {
                MessageBox.Show("请填写经度");
            }
            else
            {
                if (!double.TryParse(txtlon.Text.Trim(), out lon))
                {
                    MessageBox.Show("经度为数值类型");
                    return;
                }
            }
            if (txtlat.Text.Trim() == "")
            {
                MessageBox.Show("请填写纬度"); return;
            }
            else
            {
                if (!double.TryParse(txtlat.Text.Trim(), out lat))
                {
                    MessageBox.Show("纬度为数值类型");
                    return;
                }
            }

            if (txtalt.Text.Trim() == "")
            {
                MessageBox.Show("请填写海拔"); return;
            }
            else
            {
                if (!double.TryParse(txtalt.Text.Trim(), out alt))
                {
                    MessageBox.Show("海拔为数值类型");
                    return;
                }
            }

            if (tmpStation != null)
            {
                _ImportantLandmarkList.ID = tmpStation.ID;
            }
            _ImportantLandmarkList.Name        = txtname.Text.Trim();
            _ImportantLandmarkList.Lon         = Convert.ToDouble(txtlon.Text.Trim());
            _ImportantLandmarkList.Lat         = Convert.ToDouble(txtlat.Text.Trim());
            _ImportantLandmarkList.Alt         = Convert.ToDouble(txtalt.Text.Trim());
            _ImportantLandmarkList.Description = txtdescription.Text.Trim();
            tmpImportantLandmarkList.Add(_ImportantLandmarkList);

            if (tmpStation == null)
            {
                tmpImportantLandmark_Command._AddData(tmpImportantLandmarkList);
                result = MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK);
            }
            else if (tmpStation != null)
            {
                tmpImportantLandmark_Command._ReviseData(tmpImportantLandmarkList);
                result = MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK);
            }

            this.Close();
        }