本文整理汇总了C#中Order类的典型用法代码示例。如果您正苦于以下问题:C# Order类的具体用法?C# Order怎么用?C# Order使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Order类属于命名空间,在下文中一共展示了Order类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: Activate
public override void Activate(Actor self, Order order)
{
// TODO: Reveal submarines
// Should this play for all players?
Sound.Play("sonpulse.aud");
}
示例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;
}
示例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;
}
示例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();
}
示例6: Zombie
public Zombie(Vector2 pos)
{
this.pos = pos;
this.playerState = PlayerState.Jump;
this.order = Order.Follow;
animationPlayer.PlayAnimation(G.animations["zombie"]);
}
示例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);
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例11: OrderMaint
public OrderMaint(Guid orderId)
{
InitializeComponent();
_order = Order.GetOrder(orderId);
BindUI();
}
示例12: tl_newSendOrderRequest
long tl_newSendOrderRequest(Order o)
{
last = o;
count++;
return 0;
}
示例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;
}
示例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));
}
示例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;
}
}