Example #1
0
        public static LocationsType Convert(this LocationsTypeDTO locationsTypeDto)
        {
            var loc = new LocationsType
            {
                ItemId      = locationsTypeDto.ItemId,
                IsDeleted   = locationsTypeDto.IsDeleted,
                Updated     = locationsTypeDto.Updated,
                CorrectorId = locationsTypeDto.CorrectorId,
                FullName    = locationsTypeDto.FullName,
                ShortName   = locationsTypeDto.Name,
            };

            var department = locationsTypeDto.Department?.Convert();

            if (department != null)
            {
                loc.Department = department.IsDeleted ? Department.Unknown : department;
            }
            else
            {
                loc.Department = Department.Unknown;
            }

            return(loc);
        }
Example #2
0
 public static LocationsTypeDTO Convert(this LocationsType locationsType)
 {
     return(new LocationsTypeDTO
     {
         ItemId = locationsType.ItemId,
         IsDeleted = locationsType.IsDeleted,
         Updated = locationsType.Updated,
         CorrectorId = locationsType.CorrectorId,
         FullName = locationsType.FullName,
         Name = locationsType.ShortName,
         DepartmentId = locationsType.Department?.ItemId ?? -1
     });
 }