using ConsoleApp; using Microsoft.Extensions.DependencyInjection; using SlnMesnac.Model.domain; using SlnMesnac.Repository.service; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SlnMesnac.WPF.ViewModel { public class HandOverViewModel { private HidUtils hidUtils = new HidUtils(); private IBaseStaffService _baseStaffService; public HandOverViewModel() { Init(); _baseStaffService = App.ServiceProvider.GetService(); } #region ///// ///// 员工id ///// //private string staffId; //public string StaffIdText //{ // get { return staffId; } // set { staffId = value; OnPropertyChanged("StaffIdText"); } //} #endregion private void Init() { hidUtils.Initial(); hidUtils.StartScan(); hidUtils.pushReceiveDataEvent += (bytes, str) => { str = str.ToString().Replace(" ", ""); BaseStaffInfo user = _baseStaffService.GetStaffInfoByCardId(str); if (user != null) { string staffType = user.StaffType; if(staffType == "1") { } else { } } else { } }; } } }