You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Tiobon.Web.Core/Tiobon.Core.Services/Ghrs/Ghrs_UserServices.cs

32 lines
944 B

namespace Tiobon.Core.Services;
/// <summary>
/// 系统用户 (服务)
/// </summary>
public class Ghrs_UserServices : BaseServices<Ghrs_User, Ghrs_UserDto, InsertGhrs_UserInput, EditGhrs_UserInput>, IGhrs_UserServices
{
private readonly IBaseRepository<Ghrs_User> _dal;
public Ghrs_UserServices(IBaseRepository<Ghrs_User> dal)
{
this._dal = dal;
base.BaseDal = dal;
}
public override async Task<Ghrs_UserDto> QuerySingleDto(Expression<Func<Ghrs_User, bool>> whereExpression)
{
var entity = await base.QuerySingleDto(whereExpression);
if (entity != null)
{
var staff = await Db.Queryable<Ghra_Staff>().Where(x => x.StaffID == entity.UserStaffID).FirstAsync();
if (staff != null)
{
entity.StaffNo = staff.StaffNo;
entity.StaffName = staff.StaffName;
}
}
return entity;
}
}