예제 #1
0
 public int Update(TurnTableList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Update(entityToInsert));
     }
 }
예제 #2
0
 public int Delete(TurnTableList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Delete(entityToInsert));
     }
 }
예제 #3
0
        public void TurnTableData(TurnTableList _tmpData)
        {
            txtname.Text                       = _tmpData.Name;
            txtlon.Text                        = _tmpData.Lon.ToString();
            txtlat.Text                        = _tmpData.Lat.ToString();
            txtalt.Text                        = _tmpData.Alt.ToString();
            comboBox2.SelectedValue            = _tmpData.ErectingHeightType;
            txterectingheight.Text             = _tmpData.ErectingHeight.ToString();
            txtazimuthangle.Text               = _tmpData.AzimuthAngle.ToString();
            comboBoxProtocolType.SelectedValue = _tmpData.ProtocolType;
            txtTurntableAddr.Text              = _tmpData.TurntableAddr.ToString();
            txtCCDAddr.Text                    = _tmpData.CCDAddr.ToString();
            txtIRAddr.Text                     = _tmpData.IRAddr.ToString();
            if (_tmpData.StationID != null)
            {
                comboBox1.SelectedValue = _tmpData.StationID;
            }

            comboBoxCommunicationInternet.SelectedValue = _tmpData.CommunicationType;
            if (_tmpData.CommunicationID != null)
            {
                comboBox3.SelectedValue = _tmpData.CommunicationID;
            }

            txtdescription.Text = _tmpData.Description;
        }
예제 #4
0
 public Guid Insert(TurnTableList entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Insert <Guid>(entityToInsert));
     }
 }
예제 #5
0
        private void ToolStripMenuItem_add_Click(object sender, EventArgs e)
        {
            TurnTableList        tmpData = null;
            Add_Modify_TurnTable tmpAdd_Modify_TurnTable = new Add_Modify_TurnTable(tmpData);

            tmpAdd_Modify_TurnTable.ShowDialog();
            if (tmpAdd_Modify_TurnTable.result == DialogResult.OK)
            {
                GetTurnTableList();
            }
        }
예제 #6
0
 public Add_Modify_TurnTable(TurnTableList _tmpData)
 {
     InitializeComponent();
     if (_tmpData == null)
     {
         TypeNameDataBinding();
     }
     else if (_tmpData != null)
     {
         tmpStation = _tmpData;
         TypeNameDataBinding();
         TurnTableData(tmpStation);
     }
 }
예제 #7
0
파일: MapForm.cs 프로젝트: liuslayer/RCCP
 private void dataGridViewX_CameraExceptionList_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex < 0 || e.RowIndex < 0)
         return;
     DataGridViewColumn column = dataGridViewX_CameraExceptionList.Columns[e.ColumnIndex];
     if (column is DataGridViewButtonColumn)
     {
         string deviceID = dataGridViewX_CameraExceptionList.Rows[e.RowIndex].Cells[0].Value.ToString();
         CameraList cameraList = OMClientManager.deviceInfo.CameraList.Find(_ => _.DeviceID == Guid.Parse(deviceID));
         TurnTableList turnTableList = OMClientManager.deviceInfo.TurnTableList.Find(_ => _.DeviceID == cameraList.Turntable_PTZ_DeviceID);
         if (turnTableList == null)
             return;
         if (!turnTableList.Lat.HasValue || !turnTableList.Lon.HasValue)
             return;
         mapControl.Position = new PointLatLng(turnTableList.Lat.Value, turnTableList.Lon.Value);
         mapControl.Zoom = MapSkipLevel;
     }
 }
예제 #8
0
        private void ToolStripMenuItem_edittype_Click(object sender, EventArgs e)
        {
            TurnTableList tmpData = new TurnTableList();

            for (int i = 0; i < tmpListTurnTable.Count; i++)
            {
                if (tmpListTurnTable[i].DeviceID == _TurnTableList.DeviceID)
                {
                    tmpData = tmpListTurnTable[i];
                    break;
                }
            }
            Add_Modify_TurnTable tmpAdd_Modify_TurnTable = new Add_Modify_TurnTable(tmpData);

            tmpAdd_Modify_TurnTable.ShowDialog();
            if (tmpAdd_Modify_TurnTable.result == DialogResult.OK)
            {
                GetTurnTableList();
            }
        }
예제 #9
0
        private void btnsure_Click(object sender, EventArgs e)
        {
            double lon = 0.0, lat = 0.0, alt = 0.0, height = 0.0;
            int    Taddr = 0, CCDaddr = 0, IRaddr = 0;
            List <TurnTableList> tmpTurnTableList = new List <TurnTableList>();
            TurnTableList        _TurnTableList = new TurnTableList();
            TurnTable_Command    tmpTurnTable_Command = new TurnTable_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 (txterectingheight.Text.Trim() == "")
            {
                MessageBox.Show("请填写架设高度"); return;
            }
            else
            {
                if (!double.TryParse(txterectingheight.Text.Trim(), out height))
                {
                    MessageBox.Show("架设高度为数值类型"); return;
                }
            }

            if (txtazimuthangle.Text.Trim() == "")
            {
                MessageBox.Show("请填写偏北角"); return;
            }
            else
            {
                if (!double.TryParse(txtazimuthangle.Text.Trim(), out height))
                {
                    MessageBox.Show("偏北角为数值类型"); return;
                }
            }

            if (txtTurntableAddr.Text.Trim() == "")
            {
                MessageBox.Show("请填写转台地址"); return;
            }
            else
            {
                if (!Int32.TryParse(txtTurntableAddr.Text.Trim(), out Taddr))
                {
                    MessageBox.Show("转台地址为数值类型"); return;
                }
            }

            if (txtCCDAddr.Text.Trim() == "")
            {
                MessageBox.Show("请填写白光地址"); return;
            }
            else
            {
                if (!Int32.TryParse(txtCCDAddr.Text.Trim(), out CCDaddr))
                {
                    MessageBox.Show("白光地址为数值类型"); return;
                }
            }

            if (txtIRAddr.Text.Trim() == "")
            {
                MessageBox.Show("请填写红外地址"); return;
            }
            else
            {
                if (!Int32.TryParse(txtIRAddr.Text.Trim(), out IRaddr))
                {
                    MessageBox.Show("红外地址为数值类型"); return;
                }
            }
            if (tmpStation != null)
            {
                _TurnTableList.DeviceID = tmpStation.DeviceID;
            }

            _TurnTableList.Name = txtname.Text.Trim();

            if (comboBox1.SelectedValue.ToString() != null)
            {
                _TurnTableList.StationID = new Guid(comboBox1.SelectedValue.ToString());
            }
            else
            {
                _TurnTableList.StationID = null;
            }

            _TurnTableList.TypeID             = Convert.ToInt32(DeviceParamType.TurnTableDevice);
            _TurnTableList.Lon                = Convert.ToDouble(txtlon.Text.Trim());
            _TurnTableList.Lat                = Convert.ToDouble(txtlat.Text.Trim());
            _TurnTableList.Alt                = Convert.ToDouble(txtalt.Text.Trim());
            _TurnTableList.ErectingHeight     = Convert.ToDouble(txterectingheight.Text.Trim());
            _TurnTableList.ErectingHeightType = Convert.ToInt32(comboBox2.SelectedValue);
            _TurnTableList.AzimuthAngle       = Convert.ToInt32(txtazimuthangle.Text.Trim());
            _TurnTableList.ProtocolType       = Convert.ToInt32(comboBoxProtocolType.SelectedValue);
            _TurnTableList.TurntableAddr      = Convert.ToInt32(txtTurntableAddr.Text.Trim());
            _TurnTableList.CCDAddr            = Convert.ToInt32(txtCCDAddr.Text.Trim());
            _TurnTableList.IRAddr             = Convert.ToInt32(txtIRAddr.Text.Trim());
            _TurnTableList.CommunicationType  = Convert.ToInt32(comboBoxCommunicationInternet.SelectedValue);
            if (comboBox3.SelectedValue.ToString() != "")
            {
                _TurnTableList.CommunicationID = new Guid(comboBox3.SelectedValue.ToString());
            }
            else
            {
                _TurnTableList.CommunicationID = null;
            }

            _TurnTableList.Description = txtdescription.Text.Trim();
            tmpTurnTableList.Add(_TurnTableList);
            if (tmpStation == null)
            {
                tmpTurnTable_Command._AddData(tmpTurnTableList);
                result = MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK);
            }
            else if (tmpStation != null)
            {
                tmpTurnTable_Command._ReviseData(tmpTurnTableList);
                result = MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK);
            }
            this.Close();
        }