예제 #1
0
 private void checkBox_save_pwd_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox_save_name.Checked == true && checkBox_save_pwd.Checked == true)
     {
         if (textBox_User_Pwd.Text != "")
         {
             if (textBox_User_Pwd.Text != FileOpreate.User_Pwd)
             {
                 FileOpreate.User_Pwd = textBox_User_Pwd.Text;
                 FileOpreate.WritePrivateProfileString("用户", "密码", textBox_User_Pwd.Text, @"./Config.ini");
             }
             FileOpreate.WritePrivateProfileString("用户", "SP", "Y", @"./Config.ini");
         }
         else
         {
             checkBox_save_pwd.Checked = false;
         }
     }
     else
     {
         textBox_User_Pwd.Text = "";
         FileOpreate.WritePrivateProfileString("用户", "密码", "", @"./Config.ini");
         FileOpreate.WritePrivateProfileString("用户", "SP", "N", @"./Config.ini");
         checkBox_save_pwd.Checked = false;
     }
 }
예제 #2
0
 //保存接口配置
 private void button_SaveInterfaceConfig_Click(object sender, EventArgs e)
 {
     try
     {
         if (FileOpreate.Interface_Area == 2 || FileOpreate.Interface_Area == 3)
         {
             if (textBox_NM_sqr.Text == "" || textBox_NM_zlkzr.Text == "")
             {
                 MessageBox.Show("当前联网下必须输入授权人及质量控制员姓名!", "警告:");
                 return;
             }
             else
             {
                 FileOpreate.NM_Sqr   = textBox_NM_sqr.Text;
                 FileOpreate.NM_Zlkzr = textBox_NM_zlkzr.Text;
                 FileOpreate.WritePrivateProfileString("用户", "内蒙联授权人", FileOpreate.NM_Sqr, @"./Config.ini");
                 FileOpreate.WritePrivateProfileString("用户", "内蒙联网质量控制人", FileOpreate.NM_Zlkzr, @"./Config.ini");
             }
         }
         FileOpreate.Interface_Area    = comboBox_Interface_Area.SelectedIndex;
         FileOpreate.Interface_Address = textBox_Interface_address.Text;
         FileOpreate.Interface_Jkxlh   = textBox_Interface_jkxlh.Text;
         FileOpreate.Interface_JczID   = textBox_Interface_jczid.Text;
         FileOpreate.WritePrivateProfileString("联网信息", "联网地区", comboBox_Interface_Area.SelectedIndex.ToString(), @"./Config.ini");
         FileOpreate.WritePrivateProfileString("联网信息", "接口地址", textBox_Interface_address.Text, @"./Config.ini");
         FileOpreate.WritePrivateProfileString("联网信息", "接口序列号", textBox_Interface_jkxlh.Text, @"./Config.ini");
         FileOpreate.WritePrivateProfileString("联网信息", "检测站ID", textBox_Interface_jczid.Text, @"./Config.ini");
         MessageBox.Show("联网信息保存成功!", "保存成功");
     }
     catch (Exception ex)
     {
         MessageBox.Show("原因:" + ex.Message.ToString(), "接口配置保存错误");
     }
 }
예제 #3
0
 public string query(string xmlDoc)
 {
     FileOpreate.SaveLog(xmlDoc, "SEND", 3);
     object[] results = this.Invoke("query", new object[] {
         xmlDoc
     });
     return((string)(results[0]));
 }
예제 #4
0
 public string write(string xmlDoc)
 {
     FileOpreate.SaveLog(xmlDoc, "SEND", 3);
     try
     {
         object[] results = this.Invoke("write", new object[] {
             xmlDoc
         });
         return((string)(results[0]));
     }
     catch (Exception er)
     {
         FileOpreate.SaveLog(er.Message, "接口调用错误", 3);
         return("Failed");
     }
 }
예제 #5
0
 //保存数据库配置
 private void button_SaveDbConfig_Click(object sender, EventArgs e)
 {
     try
     {
         FileOpreate.DB_Address = textBox_DB_address.Text;
         FileOpreate.DB_Name    = textBox_DB_name.Text;
         FileOpreate.DB_User    = textBox_DB_user.Text;
         FileOpreate.DB_Pwd     = textBox_DB_pwd.Text;
         FileOpreate.WritePrivateProfileString("数据库", "服务器", textBox_DB_address.Text, @"./Config.ini");
         FileOpreate.WritePrivateProfileString("数据库", "数据库名", textBox_DB_name.Text, @"./Config.ini");
         FileOpreate.WritePrivateProfileString("数据库", "用户名", textBox_DB_user.Text, @"./Config.ini");
         FileOpreate.WritePrivateProfileString("数据库", "密码", textBox_DB_pwd.Text, @"./Config.ini");
         MessageBox.Show("数据库信息保存成功!", "保存成功");
     }
     catch (Exception ex)
     {
         MessageBox.Show("原因:" + ex.Message.ToString(), "数据库配置信息保存失败");
     }
 }
예제 #6
0
 //保存软件上传设置
 private void button_SaveUpdateSet_Click(object sender, EventArgs e)
 {
     try
     {
         FileOpreate.UpdateStyle           = comboBox_data_update_style.SelectedIndex;
         FileOpreate.UpdateFailSovle       = comboBox_update_fail_solve.SelectedIndex;
         FileOpreate.UpdateGetWaitListTime = (int)numericUpDown_SetTimeOfGetWaitList.Value;
         FileOpreate.UpdateAutoGetCarList  = checkBox_getCarListUsed.Checked ? 1 : 0;
         FileOpreate.WritePrivateProfileString("软件配置", "上传方式", FileOpreate.UpdateStyle.ToString(), @"./Config.ini");
         FileOpreate.WritePrivateProfileString("软件配置", "上传失败处理方式", FileOpreate.UpdateFailSovle.ToString(), @"./Config.ini");
         FileOpreate.WritePrivateProfileString("软件配置", "待检列表刷新间隔", FileOpreate.UpdateGetWaitListTime.ToString(), @"./Config.ini");
         FileOpreate.WritePrivateProfileString("软件配置", "是否开启自动获取待检列表", FileOpreate.UpdateAutoGetCarList.ToString(), @"./Config.ini");
         MessageBox.Show("接口配置信息保存成功!", "保存成功");
     }
     catch (Exception ex)
     {
         MessageBox.Show("原因:" + ex.Message, "软件配置保存失败");
     }
 }
예제 #7
0
        private void buttonSaveTestLineInfo_Click(object sender, EventArgs e)
        {
            try
            {
                FileOpreate.jcff.sds  = checkBox14.Checked;
                FileOpreate.jcff.asm  = checkBox15.Checked;
                FileOpreate.jcff.vmas = checkBox16.Checked;
                FileOpreate.jcff.jzjs = checkBox17.Checked;
                FileOpreate.jcff.zyjs = checkBox18.Checked;
                FileOpreate.WritePrivateProfileString("检测方法", "SDS", FileOpreate.jcff.sds ? "Y" : "N", @"./Config.ini");
                FileOpreate.WritePrivateProfileString("检测方法", "ASM", FileOpreate.jcff.asm ? "Y" : "N", @"./Config.ini");
                FileOpreate.WritePrivateProfileString("检测方法", "VMAS", FileOpreate.jcff.vmas ? "Y" : "N", @"./Config.ini");
                FileOpreate.WritePrivateProfileString("检测方法", "JZJS", FileOpreate.jcff.jzjs ? "Y" : "N", @"./Config.ini");
                FileOpreate.WritePrivateProfileString("检测方法", "ZYJS", FileOpreate.jcff.zyjs ? "Y" : "N", @"./Config.ini");

                MessageBox.Show("可检方法设置保存成功!", "保存成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show("原因:" + ex.Message, "可检方法保存失败");
            }
        }