示例#1
0
 public LocationTypeDTO UpdateLocationType(LocationTypeDTO locationType)
 {
     try
     {
         var lt = _uow.LocationTypes.Update(_locationTypeFactory.Transform(locationType));
         _uow.SaveChanges();
         return(_locationTypeFactory.Transform(lt));
     }
     catch (DBConcurrencyException)
     {
         return(null);
     }
 }
示例#2
0
 public LocationType Transform(LocationTypeDTO dto)
 {
     if (dto == null)
     {
         return(null);
     }
     return(new LocationType
     {
         LocationTypeId = dto.LocationTypeId,
         Name = dto.LocationTypeName,
         Description = dto.LocationTypeDescription
     });
 }
示例#3
0
 public LocationTypeDTO AddNewLocationType(LocationTypeDTO newLocationType)
 {
     try
     {
         var lt = _locationTypeFactory.Transform(newLocationType);
         _uow.LocationTypes.Add(lt);
         _uow.SaveChanges();
         return(_locationTypeFactory.Transform(lt));
     }
     catch (DBConcurrencyException)
     {
         return(null);
     }
 }