コード例 #1
0
 public void CreateShipment(string orderDescription)
 {
     try
     {
         using (JoinedSqlTransactionScope sqlTrans = new JoinedSqlTransactionScope())
         {
             var OrderHeaderID = FindOrderHeaderIDByDescription(orderDescription);
             if (!OrderHeaderID.HasValue)
             {
                 throw new Exception("CreateShipment=> B2C order id:" + orderDescription + "can not find order from B2C id");
             }
             NebimV3.Orders.RetailSale order = new NebimV3.Orders.RetailSale(OrderHeaderID.Value);
             //order.get
             NebimV3.Shipments.RetailSale newShipment = CreateRetailSaleShipment(order, "", null);
             CreateRetailSaleShipmentLinesFromOrderLines(order, newShipment);
             newShipment.SaveAsCompleted();
             sqlTrans.Commit();
         }
     }
     catch (Exception ex)
     {
         NebimV3.Library.V3Exception v3Ex = ex as NebimV3.Library.V3Exception;
         if (v3Ex != null)
         {
             throw new Exception(NebimV3.ApplicationCommon.ExceptionHandlerBase.Default.GetExceptionMessage(v3Ex), ex);
         }
         throw;
     }
 }
コード例 #2
0
 //creates the shipment event => stock inventory update
 private void CreateShipment(NebimV3.Orders.RetailSale order)
 {
     try
     {
         using (JoinedSqlTransactionScope sqlTrans = new JoinedSqlTransactionScope())
         {
             NebimV3.Shipments.RetailSale newShipment = CreateRetailSaleShipment(order, "", null);
             CreateRetailSaleShipmentLinesFromOrderLines(order, newShipment);
             newShipment.SaveAsCompleted();
             sqlTrans.Commit();
         }
     }
     catch (Exception ex)
     {
         NebimV3.Library.V3Exception v3Ex = ex as NebimV3.Library.V3Exception;
         if (v3Ex != null)
         {
             throw new Exception(NebimV3.ApplicationCommon.ExceptionHandlerBase.Default.GetExceptionMessage(v3Ex), ex);
         }
         throw;
     }
 }