public ShipmentEntity GetByShipmentId(string shipmentId) { using (var scope = new TransactionScope()) { ShipmentInforTemp shipmentDataModel = _unitOfWork.ShipmentTempRepository.Get(t => t.ShipmentId.Equals(shipmentId, StringComparison.CurrentCultureIgnoreCase)); if (shipmentDataModel == null) { scope.Complete(); return(null); } Mapper.CreateMap <ShipmentInforTemp, ShipmentEntity>(); var shipmentData = Mapper.Map <ShipmentInforTemp, ShipmentEntity>(shipmentDataModel); scope.Complete(); return(shipmentData); } }
public string[] GetReferenceOfShipment(string shipmentId) { using (var scope = new TransactionScope()) { string[] arr = new string[6]; ShipmentInforTemp shipmentDataModel = _unitOfWork.ShipmentTempRepository.Get(t => t.ShipmentId.Equals(shipmentId, StringComparison.CurrentCultureIgnoreCase)); if (shipmentDataModel != null) { arr[0] = shipmentDataModel.Id.ToString(); arr[1] = shipmentDataModel.ShipmentId; arr[2] = shipmentDataModel.BoxInfo.Id.ToString(); arr[3] = shipmentDataModel.BoxInfo.BoxId; arr[4] = shipmentDataModel.BoxInfo.MasterBill.Id.ToString(); arr[5] = shipmentDataModel.BoxInfo.MasterBill.MasterAirWayBill; scope.Complete(); return(arr); } scope.Complete(); return(null); } }