The following example demonstrates how a service provider could notify a barge company that a barge was shifted from the service provider's fleet to a coal terminal for loading.

Example

CopyVisual Basic - Barge Status - Shift Example
Private Sub ShiftExample()

    ' Create BargeEx Connection
    Dim BargeExConnection As New BargeEx.BargeExService( _
        "http://localhost/BargeExAgent/BargeExService.asmx", _
        "00000000", _
        "ServiceUserName", _
        "Password")

    ' Create Barge Status Message
    Dim BargeShift As New BargeEx.BargeStatus()

    ' Indicate this is a shift
    BargeShift.EventStatusType = BargeEx.CicaBargeEventStatusType.Shift

    ' Indicate this is a new message
    BargeShift.PurposeCode = BargeEx.CicaTransactionPurposeCode.NewTransaction

    ' Specify Recipient
    BargeShift.Header.ReceiverTradingPartnerNumber = "11111111"

    ' Specify Barge Shifted and Load Status of Barge
    BargeShift.BargeName = "CAG9654"
    BargeShift.LoadStatus = BargeEx.CicaBargeLoadStatus.Empty

    ' Specify when the event occurred
    BargeShift.ShiftType = BargeEx.CicaShiftType.Completed
    BargeShift.StartDateTime = Date.Parse("2008-04-14 3:00 am")
    BargeShift.EndDateTime = Date.Parse("2008-04-14 4:30 am")

    ' Specify From and To Locations
    BargeShift.LocationName = "Service Provider's Fleet"
    BargeShift.ToLocationName = "Coal Terminal"

    ' Send Message
    Dim ErrorDetails As String = ""
    Dim Result As BargeEx.SendDocumentReturnCode

    Result = BargeExConnection.SendDocument(BargeShift, ErrorDetails)

    If Result = BargeEx.SendDocumentReturnCode.Success Then
        MessageBox.Show("Shift Sent Successfully")
    Else
        MessageBox.Show("Send Document Returned: " & Result.ToString() & _
            Environment.NewLine & ErrorDetails)
    End If

End Sub
CopyC# - Barge Status - Shift Example
private void ShiftExample()
{

    // Create BargeEx Connection
    BargeEx.BargeExService BargeExConnection =
        new BargeEx.BargeExService(
        "http://localhost/BargeExAgent/BargeExService.asmx",
        "00000000",
        "ServiceUserName",
        "Password");

    // Create Barge Status Message
    BargeEx.BargeStatus BargeShift = new BargeEx.BargeStatus();

    // Indicate this is a shift
    BargeShift.EventStatusType = BargeEx.CicaBargeEventStatusType.Shift;

    // Indicate this is a new message
    BargeShift.PurposeCode = BargeEx.CicaTransactionPurposeCode.NewTransaction;

    // Specify Recipient
    BargeShift.Header.ReceiverTradingPartnerNumber = "11111111";

    // Specify Barge Shifted and Load Status of Barge
    BargeShift.BargeName = "CAG9654";
    BargeShift.LoadStatus = BargeEx.CicaBargeLoadStatus.Empty;

    // Specify when the event occurred
    BargeShift.ShiftType = BargeEx.CicaShiftType.Completed;
    BargeShift.StartDateTime = DateTime.Parse("2008-04-14 3:00 am");
    BargeShift.EndDateTime = DateTime.Parse("2008-04-14 4:30 am");

    // Specify From and To Locations
    BargeShift.LocationName = "Service Provider's Fleet";
    BargeShift.ToLocationName = "Coal Terminal";

    // Send Message
    string ErrorDetails = "";
    BargeEx.SendDocumentReturnCode Result;

    Result = BargeExConnection.SendDocument(BargeShift, ref ErrorDetails);

    if (Result == BargeEx.SendDocumentReturnCode.Success)
    {
        MessageBox.Show("Shift Sent Successfully");
    }
    else
    {
        MessageBox.Show("Send Document Returned: " +
            Result.ToString() + Environment.NewLine + ErrorDetails);
    }

}