Code: Select all
Private _order As IOrder
Private _session As Session
_session = New Session(SecurityCache.Instance)
_order = Gateway.Create(_session, CType(_context, Order))
Moderator: Phil Barton
Code: Select all
Private _order As IOrder
Private _session As Session
_session = New Session(SecurityCache.Instance)
_order = Gateway.Create(_session, CType(_context, Order))
Code: Select all
CType(_context, SoftPro.BusinessObjects.Core.Order)
Code: Select all
// for clarity, error handling has been omitted
ContextRoot root = _context.RootContext;
string orderNumber = root.GetDataItem( "Number" ) as string;
SoftPro.Select.Client.SelectServer server = new SelectServer( new Uri(@"<url>") ); // provide network credentials, etc, as appropriate
SoftPro.OrderTracking.Client.OrderTracking trackingService = server.GetService<SoftPro.OrderTracking.Client.OrderTracking>();
using ( IOrder order = trackingService.GetOrder( new OrderQuerySpec() { BaseOrderNumber = orderNumber }, true) )
{
try
{
// Do stuff with order
}
finally
{
trackingService.CloseOrder( order );
}
}
Code: Select all
Dim server As New SoftPro.Select.Client.SelectServer("http://localhost/SelectServer")
Code: Select all
IWindowFrame frame = base.GetService<IWindowFrame>();
IOrder order = frame.GetProperty("Order") as IOrder;
We are using the OnContextNonNull event to load the order data from.Phil Barton wrote:Another possible way for you to retrieve the IOrder in the snap section is:
Don't make this call in the costructor, though, in that it may fail and cause the snap section not to instantiate.Code: Select all
IWindowFrame frame = base.GetService<IWindowFrame>(); IOrder order = frame.GetProperty("Order") as IOrder;
Can you tell us what other properties are available using the GetProperty method?Phil Barton wrote:Another possible way for you to retrieve the IOrder in the snap section is:
Don't make this call in the costructor, though, in that it may fail and cause the snap section not to instantiate.Code: Select all
IWindowFrame frame = base.GetService<IWindowFrame>(); IOrder order = frame.GetProperty("Order") as IOrder;