void LinkEPCToProduct(object o) { deleControlInvoke dele = delegate(object oEpc) { string epc = oEpc as string; DataGridViewRowCollection rows = this.dgvNotStoragedPInfo.Rows; foreach (DataGridViewRow vr in rows) { DataGridViewCell cepc = (DataGridViewCell)vr.Cells[1]; if (((string)cepc.Value) == epc) { DataGridViewCheckBoxCell cbc = (DataGridViewCheckBoxCell)vr.Cells[0]; if (cbc.Value == null || ((string)cbc.Value) == Boolean.FalseString) { cbc.Value = Boolean.TrueString; AudioAlert.PlayAlert(); } break; } } }; this.Invoke(dele, o); }
public void NewMessageArrived() { //string r3 = rmu900Helper.CheckWriteEpc(); //if (r3 != string.Empty) //{ // Debug.WriteLine("写入标签成功 " + r3); //} //string r2 = rmu900Helper.CheckInventory(); //if (r2 != string.Empty) //{ // this.UpdateEpcList(r2); // //AudioAlert.PlayAlert(); // Debug.WriteLine("读取到标签 " + r2); //} string r1 = rmu900Helper.ChekcInventoryOnce(); if (r1 != string.Empty) { Debug.WriteLine("读取到标签 " + r1); AudioAlert.PlayAlert(); this.UpdateEpcList(r1); } string r = rmu900Helper.CheckRmuStatus(); if (r == "ok") { MessageBox.Show("设备状态良好!"); } }
public void new_message(string code) { //if (r1 != string.Empty) { //Debug.WriteLine("读取到标签 " + r1); AudioAlert.PlayAlert(); this.UpdateEPCtxtBox(code); } }
public void new_message(string code) { //string r2 = rmu900Helper.CheckInventory(); //if (r2 != string.Empty) //{ // Debug.WriteLine("读取到标签 " + r2); AudioAlert.PlayAlert(); this.LinkEPCToProduct(code); //} }
public void NewMessageArrived() { string r1 = rmu900Helper.ChekcInventoryOnce(); if (r1 != string.Empty) { // Debug.WriteLine("读取到标签 " + r1); AudioAlert.PlayAlert(); this.CheckToRemoteServer(r1); // this.UpdateEpcList(r1); } //string r = rmu900Helper.CheckRmuStatus(); //if (r == "ok") //{ // MessageBox.Show("设备状态良好!"); //} }
public void NewMessageArrived() { if (this.alreadyWriteSuccess == true) { return; } string r3 = rmu900Helper.CheckWriteEpc(); if (r3 != string.Empty) { this.alreadyWriteSuccess = true; AudioAlert.PlayAlert(); Debug.WriteLine("写入标签成功 " + r3); addTieBiao(); } string r1 = rmu900Helper.ChekcInventoryOnce(); if (r1 != string.Empty) { Debug.WriteLine("读取到标签 " + r1); AudioAlert.PlayAlert(); this.UpdateEpcList(r1); } }
void LinkEPCToProduct(object o) { deleControlInvoke dele = delegate(object oEpc) { string epc = oEpc as string; //根据传入的id按照以下思路处理 // 首先在当前列表中查找是否含有该id,如果有,则账物相符加1,盘亏减1 // 如果未在列表中找到该id,说明是盘盈,需要在列表中添加该产品信息,并且盘盈加1 DataGridViewRowCollection rows = this.dgvProductInfo.Rows; bool bFind = false; foreach (DataGridViewRow vr in rows) { DataGridViewCell cepc = (DataGridViewCell)vr.Cells[1]; if (((string)cepc.Value) == epc) { DataGridViewCheckBoxCell cbc = (DataGridViewCheckBoxCell)vr.Cells[0]; if (cbc.Value == null) { AudioAlert.PlayAlert(); } if ((LightStatus)cbc.Value == LightStatus.TurnedOff) { cbc.Value = LightStatus.TurnedOn; int ncrtEqul = int.Parse(this.lblEqual.Text); int ncrtLess = int.Parse(this.lblLess.Text); this.lblLess.Text = (ncrtLess - 1).ToString(); this.lblEqual.Text = (ncrtEqul + 1).ToString(); } bFind = true; break; } } if (bFind == false) { //获取具有该id的产品信息 Product p1 = new Product(epc, string.Empty, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), string.Empty, string.Empty); string jsonString = fastJSON.JSON.Instance.ToJSON(p1); HttpWebConnect helper = new HttpWebConnect(); helper.RequestCompleted += new deleGetRequestObject(helper_RequestCompleted_getProduct); string url = RestUrl.getProduct; helper.TryPostData(url, jsonString); } }; this.Invoke(dele, o); //DataTable dt1 = ctlInventory.GetProductInfoTable(epc); //if (dt1.Rows.Count > 0) //{ // //将具体的产品信息添加到详细列表里面 // if (this.dgvProductInfo.DataSource != null) // { // DataTable dt = (DataTable)this.dgvProductInfo.DataSource; // //首先检查该产品是否已经扫描过 // bool alreadyAdded = false; // foreach (DataRow dr in dt.Rows) // { // if (dr.ItemArray[0].ToString() == epc) // { // alreadyAdded = true; // break; // } // } // //如果尚未扫描过 // if (!alreadyAdded) // { // DataRow dr = dt.NewRow(); // dr.ItemArray = dt1.Rows[0].ItemArray; // dt.Rows.Add(dr); // } // } //} }