public static OrderPackage GetPackageCopy(this OrderPackage source)
        {
            if (source == null || source.Order == null)
            return null;
              OrderPackage package = new OrderPackage();

              package.Order = source.Order.GetPrimitiveCopy();
              if (source.Recipe != null)
              {
            package.Recipe = source.Recipe.GetPrimitiveCopy();
              }

              if (source.ClientBuildingPackage != null)
              {
            package.ClientBuildingPackage = source.ClientBuildingPackage.GetPackageCopy();
              }

              if (source.Client != null)
              {
            package.Client = source.Client.GetPrimitiveCopy();
              }
              return package;
        }
        public static OrderPackage GetOrderPackage(this Order order)
        {
            OrderPackage result = new OrderPackage();
              if (order != null)
              {
            result.Order = order.GetPrimitive();
            if (order.Recipe != null)
            {
              result.Recipe = order.Recipe.GetPrimitive();
            }
            if (order.ClientBuilding != null)
            {
              result.ClientBuildingPackage = new ClientBuildingAndBuildingPackage();
              result.ClientBuildingPackage.ClientBuilding = order.ClientBuilding.GetPrimitive();
              if (order.ClientBuilding.Building != null)
              {
            result.ClientBuildingPackage.Building = order.ClientBuilding.Building.GetPrimitive();
              }
              if (order.ClientBuilding.Client != null)
              {
            result.Client = order.ClientBuilding.Client.GetPrimitive();
              }
            }

            if (order.DeliveryNotes != null)
            {
              foreach (DeliveryNote deliveryNote in order.DeliveryNotes)
              {
            result.DeliveryNotePackageList.Add(deliveryNote.GetDeliveryNotePackage());
              }

            }

              }
              return result;
        }