本文整理汇总了C#中IOrder类的典型用法代码示例。如果您正苦于以下问题:C# IOrder类的具体用法?C# IOrder怎么用?C# IOrder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOrder类属于命名空间,在下文中一共展示了IOrder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Cancel
public void Cancel(IOrder order, Guid paypalGuid, string token)
{
var payPalOrder = this._queryDispatcher.Dispatch<PayPalPayment, GetPayPalPaymentByGuidQuery>(new GetPayPalPaymentByGuidQuery(paypalGuid));
payPalOrder.Cancelled();
this._commandDispatcher.Dispatch(new SavePayPalPaymentCommand(payPalOrder));
}
示例2: AddOrder
///
/// </summary>
/// <param name="article"></param>
public static void AddOrder(IOrder order)
{
// Create the Database object, using the default database service. The
// default database service is determined through configuration.
Database db = DatabaseFactory.CreateDatabase();
string sqlCommand = "InsertOrder";
DbCommand commentaryCommand = db.GetStoredProcCommand(sqlCommand);
// GlobalFunctions.GetCurrentTimeInEST()
db.AddInParameter(commentaryCommand, "UserId", DbType.String, order.UserId);
db.AddInParameter(commentaryCommand, "UniqueOrderId", DbType.String, order.OrderReferenceId);
db.AddInParameter(commentaryCommand, "MonthsOfSubscription", DbType.String, order.MonthsOfSubscription);
db.AddInParameter(commentaryCommand, "PaymentDate", DbType.DateTime, order.PaymentDate);
db.AddInParameter(commentaryCommand, "VendorReferenceId", DbType.String, order.VendorReferenceId);
db.AddInParameter(commentaryCommand, "SubscriptionStartDate", DbType.DateTime, order.SubscriptionStartDate);
db.AddInParameter(commentaryCommand, "SubscriptionEndDate", DbType.DateTime, order.SubscriptionEndDate);
using (DbConnection connection = db.CreateConnection())
{
connection.Open();
db.ExecuteNonQuery(commentaryCommand);
connection.Close();
}
}
示例3: OffsetOrderTimeFieldsToEasternStandard
public static IOrder OffsetOrderTimeFieldsToEasternStandard(IOrder order)
{
// convert sendtime to eastern
// (since postAPI currently uses that instead of UTC like it should)
order.SendTimeUTC = ConvertToEasternTime(order.SendTimeUTC);
// likewise convert stop and start time to eastern
if (order.HasProperty("StopTimeUTC"))
{
var prop = order.GetType().GetProperty("StopTimeUTC");
var offsetTime = ConvertToEasternTime(Convert.ToDateTime(prop.GetValue(order, null)));
prop.SetValue(order, offsetTime, null);
}
if (order.HasProperty("RestartTimeUTC"))
{
var prop = order.GetType().GetProperty("RestartTimeUTC");
var offsetTime = ConvertToEasternTime(Convert.ToDateTime(prop.GetValue(order, null)));
prop.SetValue(order, offsetTime, null);
}
// only on voice for now
if (order.HasProperty("StopDateTimeUTC"))
{
var prop = order.GetType().GetProperty("StopDateTimeUTC");
var offsetTime = ConvertToEasternTime(Convert.ToDateTime(prop.GetValue(order, null)));
prop.SetValue(order, offsetTime, null);
}
return order;
}
示例4: Generate
private IEnumerable<CreditCardTransaction> Generate(IOrder order, ICreditCard[] cards)
{
if (cards.IsNullOrEmpty()) yield break;
var countCard = cards.Count();
foreach (var card in cards)
{
var transaction = new CreditCardTransaction
{
/*Divide o total da compra pelo número de cartões enviados*/
AmountInCents = order.AmountInCents / countCard,
TransactionReference = order.TransactionReference,
InstallmentCount = card.InstallmentCount
};
if (card.InstantBuyKey.HasValue && card.InstantBuyKey.Value != Guid.Empty)
{
transaction.CreditCard = new CreditCard()
{
InstantBuyKey = card.InstantBuyKey.Value
};
yield return transaction;
continue;
}
transaction.CreditCard = card.Copiar<ICreditCard, CreditCard>();
Contract.Assert(card.CreditCardBrand.HasValue);
GatewayApiClient.DataContracts.EnumTypes.CreditCardBrandEnum brand;
Enum.TryParse(card.CreditCardBrand.GetValueOrDefault().ToString(), true, out brand);
transaction.CreditCard.CreditCardBrand = brand;
yield return transaction;
}
}
示例5: CompletePayment
public PaymentResult CompletePayment(IOrder order, string accessCode)
{
string url = string.Format("{0}/AccessCode/{1}", this._ewayUrl, accessCode);
var headers = new Dictionary<HttpRequestHeader, string>();
headers.Add(HttpRequestHeader.Authorization, this._authorisation);
var response = this._httpWebUtility.Get<EwayPaymentResponse>(url, 30000, headers);
if (response.StatusCode == HttpStatusCode.OK)
{
this._commandDispatcher.Dispatch(new EwayPaymentProcessedCommand(order, response.Response));
IList<string> validResponseCodes = new List<string>() { "00", "08", "10", "11", "16" };
if (validResponseCodes.Contains(response.Response.ResponseCode))
{
this._messageService.AddMessage(new PaymentCompleteMessage(order, PaymentMethod.CreditCard));
return PaymentResult.Success();
}
return PaymentResult.Error(this.GetError(response.Response));
}
else
{
this._logger.Log(LogType.Error, "unable to complete payment: " + response.StatusCode.ToString());
}
return PaymentResult.Error("Sorry there was a problem processing your payment details. Please try again.");
}
示例6: GetRoute
/// <summary>
/// This method sets the route on an order
/// </summary>
/// <param name="order">The specific order</param>
/// <returns>The new route for the order</returns>
public IRoute GetRoute(IOrder order)
{
IRoute route = null;
if (order == null)
throw new ApplicationException("Order can not be null when retrieving the route");
if (order.IsAggregateOrder)
{
if (!order.IsMonetary) // Security Order
{
IInstrument instrument = ((ISecurityOrder)order).TradedInstrument;
if (instrument == null)
throw new ApplicationException("Traded instrument on the Order can not be null when retrieving the route");
// Get the route from the instrument
if (instrument.IsTradeable)
route = ((ITradeableInstrument)instrument).DefaultRoute;
if (route == null)
{
// Get the default route
route = mapper.getDefaultRoute();
}
}
else
{
// order is monetary order
// send the order to money desk
route = mapper.getSpecificRoute(RouteTypes.MoneyDesk);
}
}
return route;
}
示例7: FromNT_OnOrderUpdate
public void FromNT_OnOrderUpdate(IOrder order, IExecution exec)
{
try
{
if (order == null)
return;
OrderFixBridge nt7fb;
ExecStatus current_exec_status;
lock (locker_)
{
nt7fb = m_orders.AddOrGet(order, string.Empty, null);
if (exec != null)
nt7fb.AddExec(exec);
current_exec_status = nt7fb.GetExecStatus();
}
if (exec == null)
SendExecutionReport(nt7fb, order.Instrument.FullName, double.NaN, double.NaN, "execution on order occured");
else
SendExecutionReport(nt7fb, order.Instrument.FullName, exec.Quantity, exec.Price, "execution on order occured");
}catch(Exception e)
{
m_logger.Info("[QuickFixApp.FromNT_OnOrderUpdate]", e.ToString());
}
}
示例8: CommClient
public CommClient(IOrder order)
{
if (order == null)
throw new ApplicationException("It is not possible to calculate the commission when the order is null.");
this.order = order;
type = CommClientType.Order;
}
示例9: RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask
/// <summary>
/// Initializes a new instance of the <see cref="RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask"/> class.
/// </summary>
/// <param name="merchelloContext">
/// The merchello context.
/// </param>
/// <param name="order">
/// The order.
/// </param>
/// <param name="keysToShip">
/// The keys to ship.
/// </param>
public RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask(IMerchelloContext merchelloContext, IOrder order, IEnumerable<Guid> keysToShip)
: base(merchelloContext, order, keysToShip)
{
_productVariantService = MerchelloContext.Services.ProductVariantService;
_shipmentService = MerchelloContext.Services.ShipmentService;
_orderService = MerchelloContext.Services.OrderService;
}
开发者ID:drpeck,项目名称:Merchello,代码行数:19,代码来源:RemoveShipmentOrderItemsFromInventoryAndPersistShipmentTask.cs
示例10: CreateSendAcceptNewOrder
public ICommand CreateSendAcceptNewOrder(FixSessionID sessionID,
IOrder order)
{
return new SendAcceptNewOrder(_sessionMediator,
sessionID,
order);
}
示例11: CreateNewOrderExecutionReport
public Message CreateNewOrderExecutionReport(IOrder o, string execID)
{
var symbol = new Symbol(o.Contract.Symbol);
var exReport = new ExecutionReport(
new OrderID(o.ID.ToString(CultureInfo.InvariantCulture)),
new ExecID(execID),
new ExecType(ExecType.NEW),
new OrdStatus(OrdStatus.NEW),
symbol,
TranslateFixFields.Translate(o.MarketSide),
new LeavesQty(o.Quantity),
new CumQty(0m),
new AvgPx(o.Price))
{
ClOrdID = new ClOrdID(o.ClOrdID),
Symbol = symbol,
OrderQty = new OrderQty(o.Quantity),
LastQty = new LastQty(0m)
};
//exReport.Set(new LastPx(o.Price));
if (TradingAccount.IsSet(o.Account))
exReport.SetField(new Account(o.Account.Name));
return exReport;
}
示例12: Charge
//create a Charge method which will do only authcatpure
//change ITransaction to TransactionType and make it protected
public Response Charge(IProfileAttributes profileAttributes, IPaymentProfileAttributes paymentProfileAttributes, IOrder order)
{
var chargeAttributes = new Dictionary<string, object>();
chargeAttributes.Add("profile", profileAttributes);
chargeAttributes.Add("paymentProfile", paymentProfileAttributes);
chargeAttributes.Add("order", order);
return GetResponse(chargeAttributes, "createCustomerProfileTransactionRequestAuthCapture.spark", new CreateCustomerProfileTransactionParser());
}
示例13: SendAcceptNewOrder
public SendAcceptNewOrder(SessionMediator sessionMediator,
FixSessionID sessionID,
IOrder order)
{
_sessionMediator = sessionMediator;
_sessionID = sessionID;
_order = order;
}
示例14: CreateOrderEditView
public IOrderEditView CreateOrderEditView(IOrder order)
{
var presenter = new OrderEditPresenter(_orderEditDataBinder, this);
var view = new OrderEditForm(presenter);
presenter.Order = order;
presenter.View = view;
return view;
}
示例15: NewExecution
public NewExecution(IOrder buySideOrder, IOrder sellSideOrder, int matchedQuantity, double matchedPrice, DateTimeOffset executionTime)
{
BuySideOrder = buySideOrder;
SellSideOrder = sellSideOrder;
MatchedPrice = matchedPrice;
MatchedQuantity = matchedQuantity;
ExecutionTime = executionTime;
}