Esempio n. 1
0
 //确定
 private void btnOk_Click(object sender, EventArgs e)
 {
     card_port = port.SelectedIndex.ToString();
     card_baud = baud.Text;
     BathClass.set_config_by_key("card_port", card_port);
     BathClass.set_config_by_key("card_baud", card_baud);
     if (noHint.Checked)
     {
         BathClass.set_config_by_key("no_hint", "true");
     }
     else
     {
         BathClass.set_config_by_key("no_hint", "false");
     }
     this.DialogResult = DialogResult.OK;
 }
Esempio n. 2
0
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            String TypeStr        = "";
            String CopyRightToCOM = "";
            String CopyRightStr   = "//上海迅赛信息技术有限公司,网址www.xunsai.com//";

            if (SmsClass.Sms_Connection(CopyRightStr, (uint)(port.SelectedIndex + 1), uint.Parse(baud.Text), out TypeStr, out CopyRightToCOM) != 1)
            {
                BathClass.printErrorMsg("设置出错,请重试!");
                return;
            }

            SmsClass.Sms_Disconnection();
            BathClass.set_config_by_key("smsPort", port.Text);
            BathClass.set_config_by_key("smsBaud", baud.Text);
            this.DialogResult = DialogResult.OK;
        }
Esempio n. 3
0
        //对话框载入
        private void LogIn_Load(object sender, EventArgs e)
        {
            connectionIP = BathClass.get_config_by_key("connectionIP");
            if (connectionIP == "")
            {
                PCListForm pCListForm = new PCListForm();
                if (pCListForm.ShowDialog() != DialogResult.OK)
                {
                    this.Close();
                    return;
                }
                connectionIP = pCListForm.ip;
                BathClass.set_config_by_key("connectionIP", connectionIP);
            }

            db = new BathDBDataContext(connectionString);

            if (!db.DatabaseExists())
            {
                BathClass.printErrorMsg("连接IP不对或者网络不通,请重试!");
                connectionIP = "";
                BathClass.set_config_by_key("connectionIP", connectionIP);
                this.Close();
                return;
            }
            if (!RegisterForm.registered())
            {
                hasRegistered = false;
            }

            if (hasRegistered)
            {
                register.Visible = false;
            }
            else if (!hasRegistered && !checkTrialTimes())
            {
                okBtn.Enabled = false;
            }

            read_users();
            id.Items.AddRange(idList.ToArray());
            if (id.Items.Count != 0)
            {
                id.Text = id.Items[0].ToString();
            }
        }