Exemplo n.º 1
0
        public ShipmentType UpdateShipmentType(ShipmentType shipmentType)
        {

            _shipmentTypeRepository.Edit(shipmentType);
            _shipmentTypeRepository.Save();

            return shipmentType;
        }
Exemplo n.º 2
0
        public OperationResult<ShipmentType> AddShipmentType(ShipmentType shipmentType)
        {

            // If there is already one which has the same name,
            // return unseccessful result back
            if (_shipmentTypeRepository.GetSingleByName(shipmentType.Name) != null)
            {

                return new OperationResult<ShipmentType>(false);
            }

            shipmentType.Key = Guid.NewGuid();
            shipmentType.CreatedOn = DateTime.Now;

            _shipmentTypeRepository.Add(shipmentType);
            _shipmentTypeRepository.Save();

            return new OperationResult<ShipmentType>(true)
            {
                Entity = shipmentType
            };
        }