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

C# Order类代码示例

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

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



Order类属于命名空间,在下文中一共展示了Order类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: lbBasicAuth_Click

    protected void lbBasicAuth_Click(object sender, EventArgs e)
    {
        string merchantId = ConfigurationManager.AppSettings["MerchantID"];
        string account = ConfigurationManager.AppSettings["Account"];
        string sharedSecret = ConfigurationManager.AppSettings["SharedSecret"];

        Merchant merchant = new Merchant(merchantId, account, sharedSecret);
        Order order = new Order("GBP", 999);
        //working
        CreditCard card = new CreditCard("MC", "5425232820001308", "0118", "Phil McCracken", "123", 1);
        //invalid
        //CreditCard card = new CreditCard("MC", "1234123412341234", "0118", "Phil McCracken", "123", 1);
        Address address = new Address("", "", "", "", "", "", "", "");
        PhoneNumbers numbers = new PhoneNumbers("", "", "", "");
        Payer payer = new Payer("Business", "test", "", "Phil", "McCracken", "", address, numbers, "", new ArrayList());

        string timestamp = Common.GenerateTimestamp();

        string autoSettle = "1";

        RealAuthTransactionResponse resp = RealAuthorisation.Auth(merchant, order, card, autoSettle, timestamp);

        lblErrorCode.Text = resp.ResultCode.ToString();
        lblResult.Text = resp.ResultMessage;
    }
开发者ID:ryanmcg1,项目名称:RealexWrapper,代码行数:25,代码来源:default.aspx.cs


示例2: Activate

        public override void Activate(Actor self, Order order)
        {
            // TODO: Reveal submarines

            // Should this play for all players?
            Sound.Play("sonpulse.aud");
        }
开发者ID:Iran,项目名称:ClassicRA,代码行数:7,代码来源:SonarPulsePower.cs


示例3: Fill

        /********************************************************
        * CLASS PROPERTIES
        *********************************************************/
        /********************************************************
        * CLASS METHODS
        *********************************************************/
        /// <summary>
        /// Perform neccessary check to see if the model has been filled, appoximate the best we can.
        /// </summary>
        /// <param name="vehicle">Asset we're working with</param>
        /// <param name="order">Order class to check if filled.</param>
        public virtual OrderEvent Fill(Security vehicle, Order order)
        {
            //Default order event to return.
            var fill = new OrderEvent(order);

            try
            {
                switch (order.Type)
                {
                    case OrderType.Limit:
                        fill = LimitFill(vehicle, order);
                        break;
                    case OrderType.StopMarket:
                        fill = StopFill(vehicle, order);
                        break;
                    case OrderType.Market:
                        fill = MarketFill(vehicle, order);
                        break;
                }
            } catch (Exception err) {
                Log.Error("SecurityTransactionModel.TransOrderDirection.Fill(): " + err.Message);
            }

            return fill;
        }
开发者ID:kevinalexanderwong,项目名称:QCAlgorithm,代码行数:36,代码来源:SecurityTransactionModel.cs


示例4: FindOrder

        public Order FindOrder(string sourceId, string customerSourceId)
        {
            if (!string.IsNullOrEmpty(sourceId))
            {
                var existingOrder = _orders.GetBySourceId(sourceId);
                if (null != existingOrder)
                {
                    if (string.IsNullOrEmpty(existingOrder.Customer?.SourceId))
                    {
                        if (!string.IsNullOrEmpty(customerSourceId))
                        {
                            existingOrder.Customer = FindCustomerBySourceId(customerSourceId);
                        }
                    }
                    return existingOrder;
                }
            }

            var order = new Order
            {
                SourceId = sourceId,
                Customer = FindCustomerBySourceId(customerSourceId)
            };
            _orders.Add(order);

            return order;
        }
开发者ID:seshbot,项目名称:asset-tracker,代码行数:27,代码来源:ShopService.cs


示例5: changeOrderState

    public void changeOrderState(Order o)
    {
        int index = getOrderIndex(o);
        if (lbOrders.InvokeRequired)
        {
            this.BeginInvoke(new changeOrderStateDelegate(changeOrderState), o);
            return;
        }

        if (Program.debug)
        {
            Console.WriteLine("My index is: " + index);
            Console.WriteLine("ORDER SELECTED");
            Console.WriteLine(o);
        }

        if (OrderState.Ready == o.State)
        {
            btnNextState.Enabled = false;
            orders.RemoveAt(index);
            lbOrders.Items.RemoveAt(index);
            btnNextState.Text = btnTexts[0];
        }
        else
        {
            btnNextState.Text = btnTexts[(int)o.State];
            lbOrders.Items[index] = "[Qty: " + o.Qt + "] " + o.Description + " - " + o.State;
            orders[index] = o;
        }

        lbOrders.Refresh();
    }
开发者ID:JosePedroMarques,项目名称:RemoteRest,代码行数:32,代码来源:MainForm.cs


示例6: Zombie

 public Zombie(Vector2 pos)
 {
     this.pos = pos;
     this.playerState = PlayerState.Jump;
     this.order = Order.Follow;
     animationPlayer.PlayAnimation(G.animations["zombie"]);
 }
开发者ID:Jemeyr,项目名称:Halloween,代码行数:7,代码来源:Zombie.cs


示例7: Activate

		public override void Activate(Actor self, Order order, SupportPowerManager manager)
		{
			base.Activate(self, order, manager);

			var wsb = self.TraitOrDefault<WithSpriteBody>();
			if (wsb != null && wsb.DefaultAnimation.HasSequence(info.GrantUpgradeSequence))
				wsb.PlayCustomAnimation(self, info.GrantUpgradeSequence);

			Game.Sound.Play(info.GrantUpgradeSound, self.World.Map.CenterOfCell(order.TargetLocation));

			foreach (var a in UnitsInRange(order.TargetLocation))
			{
				var um = a.TraitOrDefault<UpgradeManager>();
				if (um == null)
					continue;

				foreach (var u in info.Upgrades)
				{
					if (info.Duration > 0)
					{
						if (um.AcknowledgesUpgrade(a, u))
							um.GrantTimedUpgrade(a, u, info.Duration);
					}
					else
					{
						if (um.AcceptsUpgrade(a, u))
							um.GrantUpgrade(a, u, this);
					}
				}
			}
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:31,代码来源:GrantUpgradePower.cs


示例8: CancelPayment

        public override ApiInfo CancelPayment( Order order, IDictionary<string, string> settings )
        {
            ApiInfo apiInfo = null;

              try {
            order.MustNotBeNull( "order" );
            settings.MustNotBeNull( "settings" );
            settings.MustContainKey( "Vendor", "settings" );

            Dictionary<string, string> inputFields = new Dictionary<string, string>();

            inputFields[ "VPSProtocol" ] = "2.23";
            inputFields[ "TxType" ] = "CANCEL";
            inputFields[ "Vendor" ] = settings[ "Vendor" ];
            inputFields[ "VendorTxCode" ] = order.CartNumber;
            inputFields[ "VPSTxId" ] = order.TransactionInformation.TransactionId;
            inputFields[ "SecurityKey" ] = order.Properties[ "securityKey" ];

            IDictionary<string, string> responseFields = GetFields( MakePostRequest( GetMethodUrl( "CANCEL", settings ), inputFields ) );

            if ( responseFields[ "Status" ] == "OK" ) {
              apiInfo = new ApiInfo( order.TransactionInformation.TransactionId, PaymentState.Cancelled );
            } else {
              LoggingService.Instance.Log( "Sage pay(" + order.OrderNumber + ") - Error making API request: " + responseFields[ "StatusDetail" ] );
            }
              } catch ( Exception exp ) {
            LoggingService.Instance.Log( exp, "Sage pay(" + order.OrderNumber + ") - Cancel payment" );
              }

              return apiInfo;
        }
开发者ID:jizepi,项目名称:Payment-providers,代码行数:31,代码来源:SagePay.cs


示例9: RequestOrder

        public double RequestOrder(Order order)
        {
            bool productFoundInInvenory = false;
            double amount = 0;

            foreach (var product in Products)
            {
                foreach (var requestedProduct in order.OrderedItems)
                {
                    if (product.ProductID == requestedProduct.Key)
                    {
                        productFoundInInvenory = true;
                        if (product.Quantity >= requestedProduct.Value)
                        {
                            amount += product.PriceAfter * requestedProduct.Value;
                        }
                        else
                        {
                            throw new NotAvailableInInventoryException("The product is not available.");
                        }
                        break;
                    }
                }
            }

            if(!productFoundInInvenory)
            {
                throw new NotAvailableInInventoryException("The product is not present.");
            }

            return amount;
        }
开发者ID:agicheva,项目名称:Programming-101-CSharp,代码行数:32,代码来源:Inventory.cs


示例10: IncludingARelatedEntityShouldAvoidHittingTheServerTwice

		public IEnumerable<Task> IncludingARelatedEntityShouldAvoidHittingTheServerTwice()
		{
			var dbname = GenerateNewDatabaseName();
			using (var documentStore = new DocumentStore {Url = Url + Port}.Initialize())
			{
				yield return documentStore.AsyncDatabaseCommands.EnsureDatabaseExistsAsync(dbname);

				var customer = new Customer {Name = "Customer #1", Id = "customer/1", Email = "[email protected]"};
				var order = new Order {Id = "orders/1", Note = "Hello", Customer = new DenormalizedReference {Id = customer.Id, Name = customer.Name}};
				using (var session = documentStore.OpenAsyncSession(dbname))
				{
					session.Store(customer);
					session.Store(order);
					yield return session.SaveChangesAsync();
				}

				using (var session = documentStore.OpenAsyncSession(dbname))
				{
					var query = session.Advanced.AsyncLuceneQuery<Order>()
						.Include(x => x.Customer.Id)
						.WhereEquals("Id", "orders/1")
						.ToListAsync();
					yield return query;

					Assert.AreEqual("Hello", query.Result.Item2[0].Note);

					// NOTE: this call should not hit the server 
					var load = session.LoadAsync<Customer>(customer.Id);
					yield return load;

					Assert.AreEqual(1, session.Advanced.NumberOfRequests);
				}
			}
		}
开发者ID:robinminto,项目名称:ravendb,代码行数:34,代码来源:AsyncLuceneQueryTests.cs


示例11: OrderMaint

    public OrderMaint(Guid orderId)
    {
      InitializeComponent();

      _order = Order.GetOrder(orderId);
      BindUI();
    }
开发者ID:Jaans,项目名称:csla,代码行数:7,代码来源:OrderMaint.cs


示例12: tl_newSendOrderRequest

       long tl_newSendOrderRequest(Order o)
       {
           last = o;
           count++;
           return 0;
 
       }
开发者ID:antonywu,项目名称:tradelink,代码行数:7,代码来源:TestTLFastInterop.cs


示例13: OrderingFormNathan

 public OrderingFormNathan(string CustomerId, int EmployeeID, int OrderID) 
 {
     InitializeComponent();
     this.CustomerID = CustomerId;
     this.EmployeeID = EmployeeID;
     lblCustId.Text = CustomerID;
     lblEmID.Text = EmployeeID.ToString();
     Editing = true;
     OrderId = OrderID;
     lblorID.Text = OrderId.ToString();
     Order Get = Business.FindOrder(OrderId);
     Customer Cust = Business.GetCustomer((CustomerID));
     DetailsList = Business.OrderDetailList(OrderId);
     txtSDate.Text = Get.ShippedDate.ToString();
     txtRDate.Text = Get.RequiredDate.ToString();
     txtAddress.Text = Get.ShipAddress.ToString();
     txtCity.Text = Get.ShipCity.ToString();
     txtPostal.Text = Get.ShipPostalCode.ToString();
     lblFin.Text = Get.Freight.ToString();
     txtCountry.Text = Get.ShipCountry.ToString();
     txtRegion.Text = Get.ShipRegion.ToString();
     txtFax.Text = Cust.Fax.ToString();
     txtPhone.Text = Cust.Phone.ToString();
     Editing = true;
     ProductList = Business.ProductList();
     foreach (OrderDetail d in DetailsList) 
     {
         lsDetails.Items.Add(d.ProductName + " " + d.Quantity.ToString());
     }
     Test = Get;
 }
开发者ID:larryslack,项目名称:OrderingProject,代码行数:31,代码来源:OrderingFormNathan.cs


示例14: can_directly_extend_parameter_on_data_context_type

        public void can_directly_extend_parameter_on_data_context_type()
        {
            RuleParameterProviders.Providers.Clear();
            RuleParameterProviders.Providers.Add(new DefaultRuleParameterProvider());
            RuleParameterProviders.Providers.Add(new OrderParameterProvider());

            var parameters = RuleParameterProviders.Providers.SelectMany(p => p.GetParameters(typeof(Order))).ToList();
            var order = new Order
            {
                Id = 10,
                Total = 100,
                Subtotal = 80
            };

            var idParam = parameters.Find(p => p.Name == "Id");
            Assert.NotNull(idParam);
            Assert.Equal(10, idParam.ResolveValue(order));

            var subtotalParam = parameters.Find(p => p.Name == "Subtotal");
            Assert.NotNull(subtotalParam);
            Assert.Equal(80m, subtotalParam.ResolveValue(order));

            var discountParam = parameters.Find(p => p.Name == "Discount");
            Assert.NotNull(discountParam);
            Assert.Equal(20m, discountParam.ResolveValue(order));
        }
开发者ID:Kooboo,项目名称:Ecommerce,代码行数:26,代码来源:ParameterProviderExtensibilityFacts.cs


示例15: GiveOrder

    public void GiveOrder(Order order)
    {
        switch (order.OrderType) {

        case Const.ORDER_STOP:
            if (IsMoveable()) {
                if (IsDeployable ()) {
                    CancelDeploy ();
                }
                GetComponent<Movement>().Stop ();
            }
            break;

        case Const.ORDER_MOVE_TO:
            if (IsMoveable()) {
                if (IsDeployable ()) {
                    CancelDeploy ();
                }
                GetComponent<Movement>().MoveTo (order.OrderLocation);
            }
            break;

        case Const.ORDER_DEPLOY:
            GetComponent<Movement>().Stop ();
            ((IDeployable)this).Deploy();
            break;
        }
    }
开发者ID:vanblaze,项目名称:liquid-old,代码行数:28,代码来源:Unit.cs


示例16: CreateDetailTransactionsForErrorCorrection

        public void CreateDetailTransactionsForErrorCorrection(Order order, BLL.PickList picklist,
                                        Issue stvLog, int receiptPalletId, int receiptID, User user, DateTime convertedEthDate
                                        , int newItemId, int newUnitId, int newManufacturerId, decimal pickedPack
                                        , decimal Convertedpack, int confirmationStatusId, bool changeExpiryDate
                                        , DateTime? ExpiryDate, bool changeBatchNo, string batchNo)
        {
            //Load the ReceivePallet First From that we Get the Information that We need
            ReceivePallet receivePalletOriginal = new ReceivePallet();
            receivePalletOriginal.LoadByPrimaryKey(receiptPalletId);

            ReceiveDoc receiveDocOriginal = new ReceiveDoc();
            receiveDocOriginal.LoadByPrimaryKey(receivePalletOriginal.ReceiveID);

            //Load ItemUnit Detail for For ItemUnit Change;
            ItemUnit newItemUnit = new ItemUnit();
            newItemUnit.LoadByPrimaryKey(newUnitId);

              // Generate PicklistDetail With OrderDetail information
            PickListService pickListService = new PickListService();
            PickListDetail pickListDetail = pickListService.CreatePicklistDetailWithOrder(receiveDocOriginal, receivePalletOriginal, order, picklist,
                                                          pickedPack);
            // Generate IssueDoc from picklistDetail and substract the quantity from receiveDoc
            IssueService issueService = new IssueService();
            issueService.CreateIssueFromPicklist(pickListDetail, order, convertedEthDate, stvLog, user);

            if (Convertedpack > 0)
            {
                //duplicate The ReceiveDoc and ReceiptPallet
                ReceiveService receiveService = new ReceiveService();
                receiveService.CloneReceiveForErrorCorrection(confirmationStatusId, receivePalletOriginal, receiveDocOriginal
                                                                , Convertedpack, user, newItemId
                                                                , receiveDocOriginal.StoreID, receiptID
                                                                , newManufacturerId, newItemUnit, convertedEthDate,changeExpiryDate,ExpiryDate,changeBatchNo,batchNo);
            }
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:35,代码来源:TransferService.cs


示例17: StringToOrder

 public static Order StringToOrder( string str)
 {
     //		Debug.Log("string to order: "+str);
     Order ret = new Order();
     ret.skill = SkillType.noSkill; //default
     ret.endTurn = false;
     string[] splitStr = str.Split(' ');
     if(splitStr[0] == "place"){
         ret.skill = SkillType.place;
     }else if(splitStr[0] == "shoot"){
         ret.skill = SkillType.shoot;
     }else if(splitStr[0] == "build"){
         ret.skill = SkillType.build;
     }else if(splitStr[0] == "silence" || splitStr[0] == "silence."){
         ret.skill = SkillType.silence;
     }
     if(splitStr.Length > 1){ //it contains a field index
         string fStr = splitStr[1];
         int startID = fStr.IndexOf('(');
         int endID = fStr.IndexOf(')');
         int comma = fStr.IndexOf(',');
     //			Debug.Log("start: "+startID+" comma: "+comma+" end: "+endID);
     //			Debug.Log("str1: "+fStr.Substring(startID+1,comma-startID-1)+" str2: "+fStr.Substring(comma+1,endID-comma-1));
         int id1 = System.Convert.ToInt32(fStr.Substring(startID+1,comma-startID-1));
         int id2 = System.Convert.ToInt32(fStr.Substring(comma+1,endID-comma-1));
         ret.position = new FieldIndex(id1,id2);
     }
     if(splitStr[splitStr.Length-1].EndsWith(".")){
         ret.endTurn = true;
     }
     return ret;
 }
开发者ID:PxcL,项目名称:Unity_Tic-Tac-Tower,代码行数:32,代码来源:Order.cs


示例18: ResolveOrder

        public override void ResolveOrder(Actor self, Order order)
        {
            base.ResolveOrder(self, order);

            if (order.OrderString == "Stop")
                self.CancelActivity();
        }
开发者ID:sonygod,项目名称:OpenRA-Dedicated-20120504,代码行数:7,代码来源:AttackTesla.cs


示例19: updateOrderState

        internal Response updateOrderState(Order order, params Input[] inputs)
        {
            Response response = new Response();
            Input state = inputs.Where(input => input.Name == "state").ElementAt(0);

            if (state == null || state.Value == "")
                response.Errors.Add(new Error("Order state can't be empty."));

            if (!order.isAllowableState(state.Value))
                response.Errors.Add(new Error("Order state " + state.Value + " isn't acceptable."));

            if (response.Errors.Count > 0)
                response.State = ResponseState.FAIL;
            else
            {
                order.State = state.Value;
                bool orderUpdated = order.update();

                if (orderUpdated)
                    response.State = ResponseState.SUCCESS;
                else
                {
                    response.Errors.Add(new Error("Unknown Error Happened While Updating Order State."));
                    response.State = ResponseState.FAIL;
                }
            }

            return response;
        }
开发者ID:heshamhossam,项目名称:smart-hypermarket,代码行数:29,代码来源:OrderController.cs


示例20: getOrder

        protected override void getOrder(Order order, byte[] buf, int offset)
        {
            order.order = -1;
            order.charLength = 1;

            int firstByte = buf[offset] & 0xFF;
            if (firstByte == SINGLE_SHIFT_2 ||
                (firstByte >= FIRSTPLANE_HIGHBYTE_BEGIN &&
                 firstByte <= FIRSTPLANE_HIGHBYTE_END))
            {
                order.charLength = 2;
            }
            else if (firstByte == SINGLE_SHIFT_3)
            {
                order.charLength = 3;
            }

            if (firstByte == HIRAGANA_HIGHBYTE)
            {
                int secondByte = buf[offset + 1] & 0xFF;
                if (secondByte >= HIRAGANA_LOWBYTE_BEGIN &&
                    secondByte <= HIRAGANA_LOWBYTE_END)
                {
                    order.order = (secondByte - HIRAGANA_LOWBYTE_BEGIN);
                }
            }
        }
开发者ID:yinyue200,项目名称:NUniversalCharDet,代码行数:27,代码来源:EUCJPContextAnalysis.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# OrderBy类代码示例发布时间:2022-05-24
下一篇:
C# Orcamento类代码示例发布时间: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