public static EducatorEmploymentItemViewModel Build(EducatorEmployment educatorEmployment) { var language = CultureHelper.CurrentLanguage; var position = GetPositionShort(educatorEmployment, language); var formatedPosition = Regex.Replace(position, @"[\d-]", string.Empty); return(new EducatorEmploymentItemViewModel { Position = formatedPosition, Department = GetSapDepartment(educatorEmployment), }); }
private static string GetPositionShort(EducatorEmployment educatorEmployment, LanguageCode language) { return(educatorEmployment.PositionShort == null ? string.Empty : educatorEmployment.PositionShort.GetNameByLanguage(language) ?? string.Empty); }
private static string GetSapDepartment(EducatorEmployment educatorEmployment) { return(educatorEmployment.SapDepartment == null ? string.Empty : educatorEmployment.SapDepartment.Name); }