private void ESC_Click()
 {
     Window_convention01 window_convention01 = new Window_convention01();
     window_convention01.Show();
     window_convention01.tabControl1.SelectedIndex = 3;
     this.Close();//关闭当前窗口
 }
 private void ESC_Click(object sender, RoutedEventArgs e)
 {
     Window_convention01 window_convention01 = new Window_convention01();
     window_convention01.Show();
     window_convention01.tabControl1.SelectedIndex = 2;
     this.Close();//关闭当前窗口
 }
 private void OpenCoordinateSurvey(object sender, RoutedEventArgs e)
 {
     Window_convention01 window_convention01 = new Window_convention01();
     window_convention01.Show();
     window_convention01.tabControl1.SelectedIndex = 2;
     this.Close();//关闭当前窗口
 }
 private void ENT_Click(object sender, RoutedEventArgs e)
 {
     MessageBox.Show("设置成功!");
     Window_convention01 window_convention01 = new Window_convention01();
     window_convention01.Show();
     window_convention01.tabControl1.SelectedIndex = 1;
     this.Close();//关闭当前窗口
 }
 private void ENT_Click(object sender, RoutedEventArgs e)
 {
     myMessageBox my = new myMessageBox();
     my.show("HL保持");
     //MessageBox.Show("HL保持");
     Window_convention01 window_convention01 = new Window_convention01();
     window_convention01.Show();
     this.Close();//关闭当前窗口
 }
        private void ENT_Click(object sender, RoutedEventArgs e)
        {
            string odbcConnStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "\\TSISData.accdb";
            OleDbConnection conn = new OleDbConnection(odbcConnStr);

            conn.Open();
            string sql = "select CAM_V from Convention_AngleMeasure where CAM_ID=1";
            OleDbCommand cmd = new OleDbCommand(sql, conn);

            sql = "update Convention_AngleMeasure set CAM_HL= '0°0′0″' where CAM_ID=1 ";
            cmd.CommandText = sql;
            cmd.ExecuteNonQuery();
            myMessageBox my = new myMessageBox();
            my.show("置零成功!");
            //MessageBox.Show("置零成功!");
            conn.Close();
           // Lab_HL.Content = "0";

            conn.Open();
            OleDbCommand cmd1 = conn.CreateCommand();
            cmd1.CommandText = "select CAM_V ,CAM_HL from Convention_AngleMeasure where CAM_ID=1";
            OleDbDataReader reader = cmd1.ExecuteReader();
            if (reader.Read())
            {
                j1.v1 = reader["CAM_V"].ToString().Trim();
                j1.v2 = reader["CAM_HL"].ToString().Trim();
            }

            //Lab_V.DataContext = j1;
            //Lab_HL.DataContext = j1;
            reader.Close();
            conn.Close();

            Window_convention01 window_convention = new Window_convention01();
            window_convention.Show();
            this.Close();//关闭当前窗口
        }
        private void ENT_Click()
        {
            if (CAM_HL.Text.Trim() != "")
            {
                OleDbConnection conn = new OleDbConnection(odbcConnStr);
                conn.Open();
                //double CAM_HL.Text.Trim()
                double m = Convert.ToDouble( CAM_HL.Text.Trim());
                int A = Convert.ToInt32(m);
                double B = m - A ;
                int C = Convert.ToInt32(B * 100);                
                int D =Convert.ToInt32((B*100 - C)*100);
                string EF = A.ToString() + "°" + C.ToString() + "′" + D.ToString() + "″";
                myMessageBox my = new myMessageBox();
                my.show(EF);
                //MessageBox.Show(EF);
                string sql = "select CAM_HL from Convention_AngleMeasure where CAM_ID = 1 ";
                OleDbCommand cmd = new OleDbCommand(sql, conn);

                sql = "Update Convention_AngleMeasure Set CAM_HL = '" + EF + "' Where CAM_ID = 1";
                //sql = "Insert into Convention_AngleMeasure (CAM_HL) values ('" + EF + "') ";
                    cmd.CommandText = sql;
                    cmd.ExecuteNonQuery();
                   // myMessageBox my = new myMessageBox();
                    my.show("角度置盘成功!"); 
                   // MessageBox.Show("角度置盘成功!");                    
                   conn.Close();
            }
            else
            {
                myMessageBox my = new myMessageBox();
                my.show("输入角度不能为空!");
                //MessageBox.Show("输入角度不能为空!", "提示");
            }


            Window_convention01 window_convention01 = new Window_convention01();
            window_convention01.Show();
            window_convention01.tabControl1.SelectedIndex = 3;
            this.Close();//关闭当前窗口
        }