private void frmProductEdit_Shown(object sender, EventArgs e) { this.txtPalletID.Text = drEdit["PalletID"].ToString(); this.txtRFIDCode.Text = drEdit["RFIDCode"].ToString(); this.txtCreator.Text = drEdit["Creator"].ToString(); this.txtCreateDate.Text = drEdit["CreateDate"].ToString(); this.txtUpdater.Text = App.Program.CurrentUser; this.txtUpdateDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); RFIDRead.OnRFIDDisplay += new RFIDDisplayHandle(Rfid_OnRFIDDisplay); RFIDRead.Scan(); }
protected virtual void OnRFIDRead(PrinterEventArgs e) { RFIDRead?.Invoke(this, e); }
private void frmInStockTask_Shown(object sender, EventArgs e) { RFIDRead.OnRFIDDisplay += new RFIDDisplayHandle(Rfid_OnRFIDDisplay); RFIDRead.Scan(); }
private void frmInStockTask_FormClosing(object sender, FormClosingEventArgs e) { RFIDRead.StopScan(); RFIDRead.OnRFIDDisplay -= new RFIDDisplayHandle(Rfid_OnRFIDDisplay); }
private void btnSet_Click(object sender, EventArgs e) { if (!isIP(textBox1.Text.Trim()) || !isIP(textBox2.Text.Trim()) || !isIP(textBox3.Text.Trim())) { MCP.Logger.Error("请输入正确ip"); return; } #region 取IP Byte[] ipData = new Byte[12]; int p = 0; String[] aryip = textBox1.Text.Split('.'); foreach (String str in aryip) { ipData[p] = (Byte)int.Parse(str); p++; } aryip = textBox2.Text.Split('.'); foreach (String str in aryip) { ipData[p] = (Byte)int.Parse(str); p++; } aryip = textBox3.Text.Split('.'); foreach (String str in aryip) { ipData[p] = (Byte)int.Parse(str); p++; } #endregion IRP1.SysConfig_800 order = new IRP1.SysConfig_800( 0x06,//设置ip ipData); if (reader.Send(order)) { //保存到Config.xml System.Collections.Generic.Dictionary <string, string> attributes = null; ConfigUtil configUtil = new ConfigUtil(); attributes = configUtil.GetAttribute(); attributes["isTryReconnNet"] = this.cbkListenNet.Checked ? "1" : "0"; attributes["tryReconnNetTimeSpan"] = this.numReConnTime.Value.ToString(); attributes["RFIDConnetIP"] = this.textBox1.Text.Trim() + ":7086"; configUtil.Save(attributes); RFIDRead.InitRFID(); RFIDRead.Connect(); MCP.Logger.Info("设置成功"); this.DialogResult = DialogResult.OK; } else { MCP.Logger.Error("设置失败"); } }