public bool DeleteShippingInstruction(ShippingInstruction shippingInstruction)
 {
     if (shippingInstruction == null) return false;
     _unitOfWork.ShippingInstructionRepository.Delete(shippingInstruction);
     _unitOfWork.Save();
     return true;
 }
Example #2
0
 private int AddSiNumber(string siNumber)
 {
     try
     {
         var shippingInstruction = new Cats.Models.ShippingInstruction();
         shippingInstruction.Value = siNumber;
         _shippingInstructionService.AddShippingInstruction(shippingInstruction);
         return(shippingInstruction.ShippingInstructionID);
     }
     catch (Exception)
     {
         return(-1);
     }
 }
Example #3
0
 public int GetShippingInstruction(string siNumber)
 {
     var sINumber =_unitOfWork.ShippingInstructionRepository.FindBy(m => m.Value == siNumber).FirstOrDefault();
        if (sINumber==null)
        {
        var shippingInstruction = new ShippingInstruction();
        shippingInstruction.Value = siNumber;
        _unitOfWork.ShippingInstructionRepository.Add(shippingInstruction);
        return shippingInstruction.ShippingInstructionID;
        }
        return sINumber.ShippingInstructionID;
 }
        private int AddSiNumber(string siNumber)
        {
            try
            {
                var shippingInstruction = new Cats.Models.ShippingInstruction();
                shippingInstruction.Value = siNumber;
                _shippingInstructionService.AddShippingInstruction(shippingInstruction);
                return shippingInstruction.ShippingInstructionID;
            }
            catch (Exception)
            {

                return -1;
            }
        }
 public ShippingInstruction GetSiNumber(string siNumber)
 {
     var oldSiNumber = _unitOfWork.ShippingInstructionRepository.FindBy(m => m.Value == siNumber).SingleOrDefault();
     if (oldSiNumber == null)
     {
         var shippingInstruction = new ShippingInstruction()
         {
             Value = siNumber
         };
         _unitOfWork.ShippingInstructionRepository.Add(shippingInstruction);
         _unitOfWork.Save();
         return _unitOfWork.ShippingInstructionRepository.FindBy(m => m.Value == siNumber).SingleOrDefault();
     }
     return oldSiNumber;
 }
 public bool EditShippingInstruction(ShippingInstruction shippingInstruction)
 {
     _unitOfWork.ShippingInstructionRepository.Edit(shippingInstruction);
     _unitOfWork.Save();
     return true;
 }