Ejemplo n.º 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);
     }
 }
Ejemplo n.º 2
0
 public LocationType Transform(LocationTypeDTO dto)
 {
     if (dto == null)
     {
         return(null);
     }
     return(new LocationType
     {
         LocationTypeId = dto.LocationTypeId,
         Name = dto.LocationTypeName,
         Description = dto.LocationTypeDescription
     });
 }
Ejemplo n.º 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);
     }
 }