本文整理汇总了C#中Orders类的典型用法代码示例。如果您正苦于以下问题:C# Orders类的具体用法?C# Orders怎么用?C# Orders使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Orders类属于命名空间,在下文中一共展示了Orders类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Get
public OrdersResponse Get(Orders request)
{
return new OrdersResponse { Orders = new List<OrdersDto>
{
new OrdersDto {CustomerName="Test", CountItems = 10, TotalCost = 100}
}};
}
开发者ID:paaschpa,项目名称:ServiceStackPlayGround,代码行数:7,代码来源:OrdersService.cs
示例2: OrderDetails
public void OrderDetails()
{
var conn = new NHibernateConnection();
var orderRepo = new OrdersRepository(conn);
var productRepo = new ProductsRepository(conn);
var userRepo = new UserRepository(conn);
var deliveryRepo = new DeliveryTypesRepository(conn);
Users user = userRepo.Get("[email protected]");
var orderDetailsRepo = new OrderDetailsRepository(conn);
Products product = productRepo.GetAll().First();
var delivetyType = deliveryRepo.GetAll().First();
if (delivetyType == null)
{
delivetyType = new DeliveryTypes("Poczta Polska", Convert.ToDecimal(8.99));
deliveryRepo.Save(delivetyType);
}
var order = new Orders(user, DateTime.Now,
Convert.ToDecimal(299.99),delivetyType);
orderRepo.Save(order);
var orderDetails = new OrderDetails(order, product, 2, Convert.ToDecimal(29.99));
orderDetailsRepo.Save(orderDetails);
var fromDB = orderDetailsRepo.Get(orderDetails.ID);
Assert.IsNotNull(fromDB);
}
开发者ID:gpierzchala,项目名称:InternetStore,代码行数:31,代码来源:DataAccessTests.cs
示例3: OrderReceived
public void OrderReceived(Orders.Order order, MerchantTribeApplication app)
{
if (OnOrderReceived != null)
{
OnOrderReceived(this, order, app);
}
}
开发者ID:KimRossey,项目名称:MerchantTribe,代码行数:7,代码来源:Integration.cs
示例4: TryMatchOrder
public static bool TryMatchOrder(Order order, Orders orders, Trades trades)
{
List<Order> candidateOrders = order.BuySell == Order.BuyOrSell.Buy
? new List<Order>(orders.FindAll(o => o.Price <= order.Price))
: new List<Order>(orders.FindAll(o => o.Price >= order.Price));
if (candidateOrders.Count == 0)
return false;
foreach (Order candidateOrder in candidateOrders)
{
//once an order has been filled completely our job is done
if (order.Quantity == 0)
break;
ulong quantity = (candidateOrder.Quantity >= order.Quantity
? order.Quantity
: candidateOrder.Quantity);
candidateOrder.Quantity -= quantity;
order.Quantity -= quantity;
if (candidateOrder.Quantity == 0)
orders.Remove(candidateOrder);
trades.AddTrade(new Trade(order.Instrument, quantity, candidateOrder.Price));
}
return true;
}
开发者ID:sql-migrate,项目名称:OrderMatchingEngine,代码行数:28,代码来源:OrderProcessor.cs
示例5: Customer
public Customer(Guid id, AddressBook addresses, Orders orderHistory, PaymentDetails paymentDetails, LoyaltySummary loyalty)
{
this.Id = id;
this.Addresses = addresses;
this.OrderHistory = orderHistory;
this.PaymentDetails = paymentDetails;
this.Loyalty = loyalty;
}
开发者ID:elbandit,项目名称:PPPDDD,代码行数:8,代码来源:Customer.cs
示例6: Init
public void Init()
{
_orders = new Orders();
_items = new Items();
_items.Delete();
_orders.Delete();
}
开发者ID:jhuerta,项目名称:MVC3_ExploringNewFeatures,代码行数:8,代码来源:ShopifyTests.cs
示例7: GetLoadUserLastOrder
public Entities.Orders GetLoadUserLastOrder()
{
Orders order = LoggedUserLastOrder;
if (order == null)
{
order = new Orders();
}
return order;
}
开发者ID:johncoffee,项目名称:eventblock,代码行数:9,代码来源:Checkout.aspx.cs
示例8: OnOrderEvent
public override void OnOrderEvent(Orders.OrderEvent orderEvent)
{
if ((orderEvent.Direction == Orders.OrderDirection.Sell) &&
(orderEvent.Status == Orders.OrderStatus.Filled))
{
Log(string.Format("Trade {0} close at {1}", closeTradeCounter, Time));
closeTradeCounter++;
}
}
开发者ID:bizcad,项目名称:LeanITrend,代码行数:9,代码来源:TestingTradeBuilder.cs
示例9: ListAll
public Orders[] ListAll()
{
DataTable table = SqlHelper.ExecuteDataTable("select * from Orders and OrdersIsDeleted=0");
Orders[] dt = new Orders[table.Rows.Count];
for (int i = 0; i < table.Rows.Count; i++)
{
dt[i] = ToModel(table.Rows[i]);
}
return dt;
}
开发者ID:hhxyzsm,项目名称:Ordering,代码行数:10,代码来源:OrdersDAL.cs
示例10: InsertOrUpdate
public void InsertOrUpdate(Orders orders)
{
if (orders.Id == default(int))
{
context.Orders.Add(orders);
}
else
{
context.Entry(orders).State = EntityState.Modified;
}
}
开发者ID:jordanovski,项目名称:venus,代码行数:11,代码来源:OrdersRepository.cs
示例11: Insert
/// <summary>
/// 将 Orders 类型的对象插入数据库
/// </summary>
/// <param name="model"></param>
public void Insert(Orders model)
{
SqlHelper.ExecuteNonQuery(@"insert into Orders(OrdersID,OrdersBusinessID,OrdersCustID,OrdersFoodInfoID,
OrdersData,OrdersNum) values(@OrdersID,@OrdersBusinessID,@OrdersCustID,
@OrdersFoodInfoID,@OrdersData,@OrdersNum)",
new SqlParameter("@OrdersID", model.OrdersID),
new SqlParameter("@OrdersBusinessID", model.OrdersBusinessID),
new SqlParameter("@OrdersCustID", model.OrdersCustID),
new SqlParameter("@OrdersFoodInfoID", model.OrdersFoodInfoID),
new SqlParameter("@OrdersData", model.OrdersData),
new SqlParameter("@OrdersNum", model.OrdersNum));
}
开发者ID:hhxyzsm,项目名称:Ordering,代码行数:16,代码来源:OrdersDAL.cs
示例12: InsertOrder
///////////////////////////////////// Insert order functions /////////////////////////////////////
public void InsertOrder()
{
User User = new User();
User = GetOrderUser();
var Order = new Orders();
InitOrder(ref Order);
TryUpdateModel(Order);
//if (ModelState.IsValid && OrdersLogic.InsertOrder(Order, User, BasketList))
//{
// Response.Redirect("~/checkout?success=true");
//}
}
开发者ID:johncoffee,项目名称:eventblock,代码行数:15,代码来源:Checkout.aspx.cs
示例13: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Session["OrderNumber"] != null)
{
var oOrder = new Orders();
oOrder.OrdersQuickUpdate_PayStatusID(Session["OrderNumber"].ToString(), "2");
Session["Cart"] = null;
Session["CheckOut"] = null;
}
else
Response.Redirect("~/gio-hang.aspx");
}
}
开发者ID:hungtien408,项目名称:web-quanaotreem,代码行数:15,代码来源:xac-nhan-don-hang.aspx.cs
示例14: RenderLatestTrackerAndTransaction
public static string RenderLatestTrackerAndTransaction(string googleId, Orders.Order o, string storeName, string categoryName)
{
StringBuilder sb = new StringBuilder();
sb.Append("<script type=\"text/javascript\">\n");
sb.Append("var _gaq = _gaq || [];\n");
sb.Append("_gaq.push(['_setAccount', '" + googleId + "']);\n");
sb.Append("_gaq.push(['_trackPageview']);\n");
if (o != null)
{
sb.Append("_gaq.push(['_addTrans',\n");
sb.Append("'" + GoogleSafeString(o.OrderNumber) + "',\n"); // order ID - required
sb.Append("'" + GoogleSafeString(storeName) + "',\n"); // affiliation or store name
sb.Append("'" + o.TotalGrand + "',\n"); // total - required
sb.Append("'" + o.TotalTax + "',\n"); // tax
sb.Append("'" + o.TotalShippingAfterDiscounts + "',\n"); // shipping
sb.Append("'" + GoogleSafeString(o.ShippingAddress.City) + "',\n"); // city
sb.Append("'" + GoogleSafeString(o.ShippingAddress.RegionName) + "',\n"); // state or province
sb.Append("'" + GoogleSafeString(o.ShippingAddress.CountyName) + "'\n"); // country
sb.Append("]);\n");
foreach(Orders.LineItem li in o.Items)
{
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
sb.Append("_gaq.push(['_addItem',\n");
sb.Append("'" + GoogleSafeString(o.OrderNumber) + "',\n"); // order ID - required
sb.Append("'" + GoogleSafeString(li.ProductSku) + "',\n"); // SKU/code - required
sb.Append("'" + GoogleSafeString(li.ProductName) + "',\n"); // product name
sb.Append("'" + GoogleSafeString(categoryName) + "',\n"); // category or variation
sb.Append("'" + li.AdjustedPricePerItem + "',\n"); // unit price - required
sb.Append("'" + li.Quantity + "'\n"); // quantity - required
sb.Append("]);\n");
}
sb.Append("_gaq.push(['_trackTrans']);\n"); //submits transaction to the Analytics servers
}
sb.Append("(function() {\n");
sb.Append("var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n");
sb.Append("ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n");
sb.Append("var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n");
sb.Append("})();\n");
sb.Append("</script>\n");
return sb.ToString();
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:48,代码来源:GoogleAnalytics.cs
示例15: PlanSuccess
/// <summary>
/// 此方法用于客户开发成功
/// </summary>
/// <param name="cus">要添加的客户对象</param>
/// <param name="lm">要添加的联系人对象</param>
/// <param name="od">要添加的订单对象</param>
/// <param name="act">要添加的交往记录对象</param>
/// <returns></returns>
public static bool PlanSuccess(int chanID)
{
Chances chan = ChancesBLL.ChanFindById(chanID);
//判断销售机会是否修改成功
if (null == chan)
{
return false;
}
List<Plans> plList = PlansDAL.PlanFindByID(chanID);
//判断客户开发计划是否为空
if (null == plList)
{
return false;
}
//给要添加的客户初始化值
Customers cus = new Customers();
cus.CusID = CustomersBLL.GetCusID();
cus.UserID = chan.ChanDueMan;
cus.CusName = chan.ChanName;
//给要添加的联系人初始化值
LinkMans lm = new LinkMans();
lm.CusID = cus.CusID;
lm.LMName = chan.ChanName;
lm.LMMobileNo = lm.LMOfficeNo = chan.ChanLinkTel;
//给要添加的订单初始化值
Orders od = new Orders();
od.CusID = cus.CusID;
od.OrderDate = "getdate()";
//给要添加的交往记录初始化值
List<Activitys> actList = new List<Activitys>();
for (int i = 0; i < plList.Count; i++)
{
Activitys act = new Activitys();
act.CusID = cus.CusID;
act.ActDate = plList[i].PlanResultDate;
act.ActTitle = plList[i].PlanResult;
actList.Add(act);
}
return CustomersBLL.CustomerAddNew(cus) && LinkMansBLL.LinkManAddNew(lm) && OrdersBLL.OrderAddNew(od) && ActivitysBLL.ActivityAddNew(actList) && ChancesBLL.PlanSuccess(chanID);
}
开发者ID:BensterS,项目名称:CRM,代码行数:54,代码来源:PlansBLL.cs
示例16: CreateOrder
/// <summary>
/// Метод создания заказа
/// </summary>
/// <param name="order"></param>
public bool CreateOrder(OrdersDTO order)
{
try
{
Orders OrderDAL = new Orders();
OrderDAL.CustomerID = order.CustomerID;
OrderDAL.OrderDate = order.OrderDate;
if (Data.CreateOrder(OrderDAL) != true)
return true;
else return false;
}
catch (ArgumentException ex)
{
throw new ValidationException(ex.Message, ex.ParamName);
}
}
开发者ID:TottoroChan,项目名称:lab.net,代码行数:21,代码来源:BLLDB.cs
示例17: btnRefund_Click
protected void btnRefund_Click( object sender , EventArgs e )
{
PayPalManager payPal = new PayPalManager();
payPal.RefundTransaction( Request.QueryString[ "TransId" ] );
Orders orders = new Orders();
ProcessUpdateOrder updateOrder = new ProcessUpdateOrder();
int refundedstatustype = 3;
orders.OrderId = int.Parse( Request.QueryString["OrderId"] );
orders.OrderStatusId = refundedstatustype;
orders.ShipDate = ( DateTime ) SqlDateTime.Null;
updateOrder.Orders = orders;
try
{
updateOrder.Invoke();
if (payPal.IsSubmissionSuccess)
{
EmailManager emailMngr = new EmailManager();
EmailContents mailContents = new EmailContents();
mailContents.To = Request.QueryString["Email"];
mailContents.Bcc = EmailAddressConstants.Simon;
mailContents.Subject = "Live Free Range Update - Order ID: " + Request.QueryString["OrderID"];
mailContents.Body = "Your order has been refunded. Please log into your account for details.";
mailContents.FromEmailAddress = EmailAddressConstants.Contact;
emailMngr.Send(mailContents);
if (!emailMngr.IsSent)
{
Response.Redirect("../ErrorPage.aspx");
}
}
}
catch(Exception ex)
{
Response.Redirect("../ErrorPage.aspx");
}
Response.Redirect("Orders.aspx");
}
开发者ID:simonbegg,项目名称:LiveFreeRange,代码行数:45,代码来源:OrderDetails.aspx.cs
示例18: GetAlbums
/// <summary>
/// Retrieve all albums from specified artist or genre
/// </summary>
public async Task<IMediaItemList<Album>> GetAlbums(int? artistId, int? genreId, AlbumFields fields, int? startIndex, int? endIndex, SortMethods? sortMethod, Orders? order)
{
List<JsonParam> parameters = new List<JsonParam>();
parameters.AddRange(ClientUtils.GetLimitsParameter(startIndex, endIndex));
parameters.AddRange(ClientUtils.GetSortOrderParameter(sortMethod, order));
parameters.Add(new JsonParam("properties", fields ?? DefaultAlbumProperties));
List<JsonParam> filters = new List<JsonParam>();
filters.AddRange(ClientUtils.GetOptionalParameter(artistId, "artistid"));
filters.AddRange(ClientUtils.GetOptionalParameter(genreId, "genreid"));
if (filters.Any())
{
JsonParamObject filter = new JsonParamObject("filter", filters.ToArray());
parameters.Add(filter);
}
return await _client.PostAsync("AudioLibrary.GetAlbums", _serializer.Parse<XbmcItemList<Album>>, parameters.ToArray());
}
开发者ID:mjeanrichard,项目名称:XBMC-Net-Library,代码行数:21,代码来源:AudioLibraryClient.cs
示例19: Populate
public void Populate(Orders.Order o, OrderService svc)
{
Clear();
foreach (Orders.OrderTransaction t in svc.Transactions.FindForOrder(o.bvin))
{
_TotalCredit += t.AmountAppliedToOrder;
switch (t.Action)
{
case MerchantTribe.Payment.ActionType.CashReceived:
case MerchantTribe.Payment.ActionType.CheckReceived:
case MerchantTribe.Payment.ActionType.CreditCardCapture:
case MerchantTribe.Payment.ActionType.CreditCardCharge:
case MerchantTribe.Payment.ActionType.GiftCardCapture:
case MerchantTribe.Payment.ActionType.GiftCardDecrease:
case MerchantTribe.Payment.ActionType.PayPalCapture:
case MerchantTribe.Payment.ActionType.PayPalCharge:
case MerchantTribe.Payment.ActionType.PurchaseOrderAccepted:
case MerchantTribe.Payment.ActionType.CompanyAccountAccepted:
case MerchantTribe.Payment.ActionType.RewardPointsCapture:
case MerchantTribe.Payment.ActionType.RewardPointsDecrease:
_AmountCharged += t.AmountAppliedToOrder;
break;
case MerchantTribe.Payment.ActionType.CreditCardHold:
case MerchantTribe.Payment.ActionType.GiftCardHold:
case MerchantTribe.Payment.ActionType.PayPalHold:
case MerchantTribe.Payment.ActionType.RewardPointsHold:
_AmountAuthorized += t.AmountHeldForOrder;
break;
case MerchantTribe.Payment.ActionType.CashReturned:
case MerchantTribe.Payment.ActionType.CheckReturned:
case MerchantTribe.Payment.ActionType.CreditCardRefund:
case MerchantTribe.Payment.ActionType.GiftCardIncrease:
case MerchantTribe.Payment.ActionType.PayPalRefund:
case MerchantTribe.Payment.ActionType.RewardPointsIncrease:
_AmountRefunded += -1 * t.AmountAppliedToOrder;
break;
}
}
_PaymentsSummary = svc.OrdersListPaymentMethods(o);
_AmountDue = o.TotalGrand - _TotalCredit;
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:44,代码来源:OrderPaymentSummary.cs
示例20: CancelAvalaraTaxDocument
public static void CancelAvalaraTaxDocument(Orders.Order order, MerchantTribeApplication app)
{
string docId = order.CustomProperties.GetProperty("bvsoftware", BVAvaTax.AvalaraTaxPropertyName);
var result = BVAvaTax.CancelTax(app.CurrentStore.Settings.Avalara.ServiceUrl,
app.CurrentStore.Settings.Avalara.Account,
app.CurrentStore.Settings.Avalara.LicenseKey,
app.CurrentStore.Settings.Avalara.CompanyCode,
app.CurrentStore.Settings.Avalara.Username,
app.CurrentStore.Settings.Avalara.Password,
order.OrderNumber, docId, DocumentType.SalesInvoice);
if (!result.Success)
{
foreach(var m in result.Messages)
{
EventLog.LogEvent("CancelAvalaraTaxes", m, Web.Logging.EventLogSeverity.Information);
}
if (app.CurrentStore.Settings.Avalara.DebugMode)
{
string note = "Avalara - Cancel Tax Request Failed:";
foreach(var m in result.Messages)
{
note += "\n" + m;
}
order.Notes.Add(new Orders.OrderNote() {
IsPublic = false,
Note = note});
app.OrderServices.Orders.Update(order);
}
} else {
if (app.CurrentStore.Settings.Avalara.DebugMode)
{
order.Notes.Add(new Orders.OrderNote() {
IsPublic = false,
Note = "Avalara - Cancel Tax Request Succeeded"});
app.OrderServices.Orders.Update(order);
EventLog.LogEvent("CancelAvalaraTaxes", "Avalara Taxes successfully cancelled. DocId: " + docId, Web.Logging.EventLogSeverity.Information);
}
}
}
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:43,代码来源:AvalaraUtilities.cs
注:本文中的Orders类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论