private void btnOK_Click(object sender, EventArgs e) { //保存重新设置的总车位时,需要与当前已使用的量做比较 //如果设置的新量小于当前使用量,就不能保存 try { int new_count = (int)this.numberCount.Value; if (new_count < staticClass.current_used_count) { MessageBox.Show("当前使用的车位数量已经超过设置的最大数量,请将车位数设置的更大些!"); } else { staticClass.total_count = new_count; ConfigDB.saveConfig("total_count", staticClass.total_count); } staticClass.comport_name = this.cmbPortName.Text; nsConfigDB.ConfigDB.saveConfig("comport_name", staticClass.comport_name); this.Close(); if (this.last_form != null) { this.last_form.refresh(); } } catch (System.Exception ex) { } }
private void button1_Click(object sender, EventArgs e) { if (this.checkValidation()) { ConfigDB.saveConfig("wssUrl", this.txtIP.Text); //ConfigDB.saveConfig("port", this.txtPort.Text); sysConfig.wssUrl = this.txtIP.Text; //sysConfig.tcp_port = int.Parse(this.txtPort.Text); this.Close(); } }
private void button1_Click(object sender, EventArgs e) { if (this.checkValidation()) { //string portName = this.cmbPortName.Text; string ip = this.txtIP.Text; string tcpPort = this.txtPort.Text; //ConfigDB.saveConfig("comportName", portName); ConfigDB.saveConfig("ip", ip); ConfigDB.saveConfig("tcp_port", tcpPort); staticClass.rest_ip = ip; //sysConfig.comportName = portName; staticClass.rest_port = tcpPort; this.Close(); } }
private void btnSave_Click(object sender, EventArgs e) { if (this.checkValidation()) { string portName = this.cmbPortName.Text; string portBaut = this.cmbBaut.Text; string tcpPort = this.txtPort.Text; ConfigDB.saveConfig("comportName", portName); ConfigDB.saveConfig("baudRate", portBaut); ConfigDB.saveConfig("tcp_port", tcpPort); sysConfig.baudRate = portBaut; sysConfig.comportName = portName; sysConfig.tcp_port = int.Parse(tcpPort); this.Close(); } }
private void button1_Click(object sender, EventArgs e) { if (this.checkValidation()) { string portName = this.cmbPortName.Text; string ip = this.txtIP.Text; string tcpPort = this.txtPort.Text; ConfigDB.saveConfig("comportName", portName); ConfigDB.saveConfig("ip", ip); ConfigDB.saveConfig("tcp_port", tcpPort); sysConfig.ip = ip; sysConfig.comportName = portName; sysConfig.tcp_port = int.Parse(tcpPort); this.Close(); } }
public static void savePortName(string port) { ConfigDB.saveConfig("portName", port); portName = port; }