/// <summary> /// 根据报销明细ID返回报销明细对象 /// </summary> /// <param name="ID">报销明细ID</param> public RB_RowsDto GetRowByRowID(int ID) { RB_RowsDto rr = Mapper.Map <RB_Rows, RB_RowsDto> (_rbrowsRepository.GetByID(ID).AsNoTracking().FirstOrDefault()); if (rr != null && !string.IsNullOrEmpty(rr.R_TypeID)) { RB_RType rt = _rbTypeRepository.GetByID(rr.R_TypeID); if (rt != null) { rr.R_TypeName = rt.RB_RT_Name; } } return(rr); }
/// <summary> /// 根据消费类型模板ID返回消费类型模板对象 /// </summary> /// <param name="ID">消费类型模板ID</param> public RB_RType_TemplateDto GetTemplateByTemplateID(string ID) { RB_RType_TemplateDto dto = Mapper.Map <RB_RType_Template, RB_RType_TemplateDto> (_rbTypeTemplateRepository.GetByID(ID).AsNoTracking().FirstOrDefault()); if (!string.IsNullOrEmpty(dto.RB_RTT_TypeID)) { RB_RType rt = _rbTypeRepository.GetByID(dto.RB_RTT_TypeID); if (rt != null) { dto.RB_TypeName = rt.RB_RT_Name; } } return(dto); }
/// <summary> /// 根据用户ID返回消费类型模板对象 /// </summary> /// <param name="UserID">用户ID</param> public List <RB_RType_TemplateDto> GetTemplateByCreateUser(string UserID) { List <RB_RType_TemplateDto> dtos = Mapper.Map <List <RB_RType_Template>, List <RB_RType_TemplateDto> > (_rbTypeTemplateRepository.GetByCreateUser(UserID).AsNoTracking().ToList()); if (dtos.Count > 0) { foreach (RB_RType_TemplateDto dto in dtos) { if (!string.IsNullOrEmpty(dto.RB_RTT_TypeID)) { RB_RType rt = _rbTypeRepository.GetByID(dto.RB_RTT_TypeID); if (rt != null) { dto.RB_TypeName = rt.RB_RT_Name; } } } } return(dtos); }
/// <summary> /// 根据用户ID返回未报销的消费明细对象 /// </summary> /// <param name="UserID">用户ID</param> public List <RB_RowsDto> GetRowsByCreateUser(string UserID) { List <RB_RowsDto> rows = Mapper.Map <List <RB_Rows>, List <RB_RowsDto> >(_rbrowsRepository.GetByCreateUser(UserID).AsNoTracking().ToList()); if (rows.Count > 0) { foreach (RB_RowsDto row in rows) { if (!string.IsNullOrEmpty(row.R_TypeID)) { RB_RType rt = _rbTypeRepository.GetByID(row.R_TypeID); if (rt != null) { row.R_TypeName = rt.RB_RT_Name; } } } } return(rows); }