• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IOrder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IOrder的典型用法代码示例。如果您正苦于以下问题:C# IOrder类的具体用法?C# IOrder怎么用?C# IOrder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IOrder类属于命名空间,在下文中一共展示了IOrder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
        }
开发者ID:Brontsy,项目名称:Vintage-Rabbit,代码行数:7,代码来源:PayPalService.cs


示例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();
            }
        }
开发者ID:karthikxx,项目名称:USAdvisory,代码行数:29,代码来源:OrdersDAL.cs


示例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;
        }
开发者ID:julyfortoday,项目名称:APIClient,代码行数:31,代码来源:Utilities.cs


示例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;
     }
 }
开发者ID:GustavoAmerico,项目名称:TicketsNow,代码行数:30,代码来源:MundiPaggClient.cs


示例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.");
        }
开发者ID:Brontsy,项目名称:Vintage-Rabbit,代码行数:29,代码来源:CreditCardService.cs


示例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;
        }
开发者ID:kiquenet,项目名称:B4F,代码行数:40,代码来源:OrderRouteMapper.cs


示例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());
            }
        }
开发者ID:redrhino,项目名称:NinjaTrader_FixBridge,代码行数:25,代码来源:QuickFixApp.cs


示例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;
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:7,代码来源:CommClient.cs


示例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);
 }
开发者ID:naziway,项目名称:testtask,代码行数:7,代码来源:CommandFactory.cs


示例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;
        }
开发者ID:naziway,项目名称:testtask,代码行数:27,代码来源:Fix44MessageGenerator.cs


示例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());
 }
开发者ID:minhajuddin,项目名称:authnet_processor,代码行数:10,代码来源:Gateway.cs


示例13: SendAcceptNewOrder

 public SendAcceptNewOrder(SessionMediator sessionMediator,
                           FixSessionID sessionID,
                           IOrder order)
 {
     _sessionMediator = sessionMediator;
     _sessionID = sessionID;
     _order = order;
 }
开发者ID:naziway,项目名称:testtask,代码行数:8,代码来源:SendAcceptNewOrder.cs


示例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;
 }
开发者ID:hehuolong,项目名称:CslaRepositoryTest,代码行数:8,代码来源:ViewFactory.cs


示例15: NewExecution

 public NewExecution(IOrder buySideOrder, IOrder sellSideOrder, int matchedQuantity, double matchedPrice, DateTimeOffset executionTime)
 {
     BuySideOrder = buySideOrder;
     SellSideOrder = sellSideOrder;
     MatchedPrice = matchedPrice;
     MatchedQuantity = matchedQuantity;
     ExecutionTime = executionTime;
 }
开发者ID:ThomasVestergaard,项目名称:MemExchange,代码行数:8,代码来源:NewExecution.cs


示例16: NewOrderAccepted

 public void NewOrderAccepted(FixSessionID ownerSessionID, IOrder order)
 {
     var orders = new List<IOrder> {order};
     foreach (var sessionID in GetAllLoggedInSessions())
     {
         SendOrders(sessionID, orders);
     }
 }
开发者ID:naziway,项目名称:testtask,代码行数:8,代码来源:SessionMediator.cs


示例17: FromFIX_CancelOrder

 public void FromFIX_CancelOrder(IOrder p_order)
 {
     ThreadPool.QueueUserWorkItem(new WaitCallback(obj =>
     {
         lock (locker_)
             CancelOrder(p_order);
     }));
 }
开发者ID:redrhino,项目名称:NinjaTrader_FixBridge,代码行数:8,代码来源:FixConnector.cs


示例18: CrumbleTransaction

 public CrumbleTransaction(IOrder order, ICrumbleAccount acctA, IAccount acctB,
         InstrumentSize valueSize, Price price, decimal exRate, DateTime transactionDate,
         DateTime transactionDateTime, Decimal ServiceChargePercentage, Side txSide, ITradingJournalEntry tradingJournalEntry,
         IGLLookupRecords lookups, ListOfTransactionComponents[] components)
     : base(order, acctA, acctB, valueSize, price, exRate, transactionDate, transactionDateTime, ServiceChargePercentage,
         txSide, tradingJournalEntry, lookups, components)
 {
 }
开发者ID:kiquenet,项目名称:B4F,代码行数:8,代码来源:CrumbleTransaction.cs


示例19: Submit

        //override is mandatory to use event in derived class
        //public override event EventHandler<BasePayment.ConfirmEventArgs> OnConfirm;
        public override void Submit(IOrder order, NameValueCollection data = null)
        {
            //submit and redir to banktransfer summary page
            var fields = new NameValueCollection();
            fields.Add("p", "bank-transfer");
            fields.Add("item_number", order.OrderRef);

            RedirHelper.RedirectAndPOST(base.Page, base.PaymentData.PaySubmitUrl, fields);
        }
开发者ID:liqueflies,项目名称:pigeoncms,代码行数:11,代码来源:BankTransfer.cs


示例20: OnOrderUpdate

 protected override void OnOrderUpdate(IOrder order)
 {
     if (_latestSubmittedOrder != null && _latestSubmittedOrder == order)
     {
         Print(order.ToString());
         if (order.OrderState == OrderState.Filled)
             _latestSubmittedOrder = null;
     }
 }
开发者ID:redrhino,项目名称:NinjaTrader.Base,代码行数:9,代码来源:AsianAssault.cs



注:本文中的IOrder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IOrderProcessingService类代码示例发布时间:2022-05-24
下一篇:
C# IOrchardServices类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap