/// <summary> /// 根据请假单ID返回请假单对象 /// </summary> /// <param name="ID">请假单ID</param> public LeaveDetailDto GetByID(string ID) { LeaveDetailDto lv = Mapper.Map <Leave, LeaveDetailDto> (_leaveRepository.GetByID(ID).AsNoTracking().FirstOrDefault()); if (lv != null && !string.IsNullOrEmpty(lv.L_TypeID)) { LeaveType lt = _leaveTypeRepository.GetByID(lv.L_TypeID); if (lt != null) { lv.L_TypeName = lt.L_T_Name; } } return(lv); }