You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
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<IBaseStaffService>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// 员工id
|
|
|
|
|
///// </summary>
|
|
|
|
|
//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
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|