コード例 #1
0
ファイル: frmCoCreate.cs プロジェクト: weenong/SmoSEC
 private void r2000Scanner1_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(btnLocation.Text))
         {
             throw new Exception();
         }
         else
         {
             string    RFID = e.Epc;
             DataTable info = _autofacConfig.SettingService.GetUnUsedAssEx(LocationId, RFID);
             if (info.Rows.Count == 0)
             {
                 throw new Exception();
             }
             else
             {
                 DataRow row = info.Rows[0];
                 AddAss(row["ASSID"].ToString(), RFID, row["IMAGE"].ToString(), row["NAME"].ToString());
                 BindListView();
             }
         }
     }
     catch (Exception ex)
     {
         if (ex.Message != "引发类型为“System.Exception”的异常。")
         {
             Toast(ex.Message);
         }
     }
 }
コード例 #2
0
ファイル: frmBoCreate.cs プロジェクト: wanghx12/asset
 /// <summary>
 /// 手持按键扫描到RFID时
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void r2000Scanner1_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(btnLocation.Text))
         {
             throw new Exception();
         }
         else
         {
             string    RFID = e.Epc;
             DataTable info = _autofacConfig.SettingService.GetUnUsedAssEx(RFID);
             if (info.Rows.Count == 0)
             {
                 throw new Exception();
             }
             else
             {
                 DataRow row   = info.Rows[0];
                 var     type  = _autofacConfig.assTypeService.GetByID(int.Parse(row["asset_type_id"].ToString()));
                 var     brand = _autofacConfig.assBrandService.GetByID(int.Parse(row["brand_id"].ToString()));
                 AddAss(int.Parse(row["id"].ToString()), RFID, type.name, brand.name);
                 BindListView(); //重新绑定数据
             }
         }
     }
     catch (Exception ex)
     {
         if (ex.Message != "引发类型为“System.Exception”的异常。")
         {
             Toast(ex.Message);
         }
     }
 }
コード例 #3
0
 private void r2000Scanner1_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
 {
     try
     {
         string    RFID  = e.Epc;
         DataTable table = _autofacConfig.SettingService.GetAssetsBySN(RFID);
         gridAssRows.Cells.Clear();
         table.Columns.Add("ChangeText");
         table.Columns.Add("IsChecked");
         foreach (DataRow Row in table.Rows)
         {
             if (String.IsNullOrEmpty(Row["CurrentUser"].ToString()) == false)
             {
                 Row["ChangeText"] = "使用人更换";
             }
             if (Row["AssId"].ToString() == SelectAssId)
             {
                 Row["IsChecked"] = true;
             }
             else
             {
                 Row["IsChecked"] = false;
             }
         }
         if (table.Rows.Count > 0)
         {
             gridAssRows.DataSource = table;
             gridAssRows.DataBind();
         }
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }
コード例 #4
0
 private void r2000Scanner1_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
 {
     try
     {
         string RFID = e.Epc;
         txtSN.Text = RFID;
     }
     catch (Exception ex)
     {
         Toast(ex.Message);
     }
 }
コード例 #5
0
ファイル: frmAssIn.cs プロジェクト: UndeadIdler/SmoWMS
        /// <summary>
        /// 手持扫描到RFID时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void r2000ScanForSN_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
        {
            string RFID = e.Epc;

            if (!snList.Contains(RFID))
            {
                bool isExists = _autofacConfig.SettingService.SNIsExists(RFID);
                if (!isExists)
                {
                    AddSnToDataTable(RFID);
                }
            }
        }
コード例 #6
0
 /// <summary>
 /// 当手持扫描到RFID时
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void r2000Scanner1_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
 {
     try
     {
         AssetsOrderRow Data = new AssetsOrderRow();
         SN = e.Epc;
         Assets assets = autofacConfig.orderCommonService.GetUnusedAssetsBySN(SN);
         if (assets == null)
         {
             throw new Exception();
         }
         if (assets.SLID == lblLocation.Tag.ToString())
         {
             throw new Exception();
         }
         Data.ASSID  = assets.ASSID;
         Data.WAREID = assets.WAREID;
         Data.STID   = assets.STID;
         Data.SLID   = assets.SLID;
         Data.IMAGE  = assets.IMAGE;
         Data.QTY    = 0;
         Data.SN     = SN;
         if (SNRowData != null)
         {
             foreach (AssetsOrderRow Row in SNRowData)
             {
                 if (Data.ASSID == Row.ASSID && Data.SN == Row.SN)
                 {
                     throw new Exception();
                 }
             }
             SNRowData.Add(Data);
         }
         else
         {
             List <AssetsOrderRow> Datas = new List <AssetsOrderRow>();
             Datas.Add(Data);
             SNRowData = Datas;
         }
         Bind();        //重新绑定数据
     }
     catch (Exception ex)
     {
         if (ex.Message != "引发类型为“System.Exception”的异常。")
         {
             Toast(ex.Message);
         }
     }
 }
コード例 #7
0
        /// <summary>
        /// 手持扫描到RFID时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void r2000ScanForSN_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
        {
            string RFID = e.Epc;

            if (!snList.Contains(RFID))
            {
                bool isExists = _autofacConfig.AssSalesOrderService.SNIsOK(SOID, RFID);
                if (isExists)
                {
                    Assets assets = _autofacConfig.SettingService.GetBySN(RFID);
                    AddSnToDataTable(RFID, assets.IMAGE);
                }
                else
                {
                }
            }
        }
コード例 #8
0
        /// <summary>
        /// 扫描到RFID时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void r2000Scanner1_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
        {
            string RFID  = e.Epc;
            string assId = "";

            DataRow row = allAssTable.Rows.Find(RFID);

            if (row != null)
            {
                assId = row["ASSID"].ToString();
                if ((assList.Contains(assId) && waiTable.Rows.Find(assId) != null) ||
                    (!assDictionary.ContainsKey(assId) && alreadyTable.Rows.Find(assId) == null))
                {
                    AddAssToDictionary(assId, RFID);
                }
            }
        }
コード例 #9
0
ファイル: frmAssOut.cs プロジェクト: UndeadIdler/SmoWMS
        /// <summary>
        /// 手持扫描到RFID时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void r2000ScanForSN_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
        {
            string RFID = e.Epc;

            if (!snList.Contains(RFID))
            {
                bool isExists = _autofacConfig.SettingService.SOSNIsExists(RFID, TemplateIds);
                if (isExists)
                {
                    Assets assets = _autofacConfig.SettingService.GetBySN(RFID);
                    AddSnToDataTable(RFID, assets.IMAGE);
                }
                else
                {
//                    throw new Exception("该序列号不在库中!");
                }
            }
        }
コード例 #10
0
 /// <summary>
 /// 手持按键扫描到RFID时
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void r2000Scanner1_RFIDDataCaptured(object sender, Smobiler.Device.R2000RFIDScanEventArgs e)
 {
     //try
     //{
     //    AssetsOrderRow Data = new AssetsOrderRow();
     //    SN = e.Epc;
     //    Assets assets = autofacConfig.orderCommonService.GetUnusedAssetsBySN(SN);
     //    if (assets == null) throw new Exception();
     //    Data.ASSID = assets.ASSID;
     //    Data.LOCATIONID = assets.LOCATIONID;
     //    Data.IMAGE = assets.IMAGE;
     //    Data.QTY = 0;
     //    Data.SN = SN;
     //    if (SNRowData != null)
     //    {
     //        foreach (AssetsOrderRow Row in SNRowData)
     //        {
     //            if (Data.ASSID == Row.ASSID)
     //                throw new Exception();
     //        }
     //        SNRowData.Add(Data);
     //    }
     //    else
     //    {
     //        List<AssetsOrderRow> Datas = new List<AssetsOrderRow>();
     //        Datas.Add(Data);
     //        SNRowData = Datas;
     //    }
     //    Bind();        //重新绑定数据
     //}
     //catch (Exception ex)
     //{
     //    if(ex.Message!= "引发类型为“System.Exception”的异常。")
     //    {
     //        Toast(ex.Message);
     //    }
     //}
 }