本文整理汇总了C#中Orders类的典型用法代码示例。如果您正苦于以下问题:C# Orders类的具体用法?C# Orders怎么用?C# Orders使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Orders类属于命名空间,在下文中一共展示了Orders类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get
public OrdersResponse Get(Orders request)
{
return new OrdersResponse { Orders = new List<OrdersDto>
{
new OrdersDto {CustomerName="Test", CountItems = 10, TotalCost = 100}
}};
}
示例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);
}
示例3: OrderReceived
public void OrderReceived(Orders.Order order, MerchantTribeApplication app)
{
if (OnOrderReceived != null)
{
OnOrderReceived(this, order, app);
}
}
示例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;
}
示例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;
}
示例6: Init
public void Init()
{
_orders = new Orders();
_items = new Items();
_items.Delete();
_orders.Delete();
}
示例7: GetLoadUserLastOrder
public Entities.Orders GetLoadUserLastOrder()
{
Orders order = LoggedUserLastOrder;
if (order == null)
{
order = new Orders();
}
return order;
}
示例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++;
}
}
示例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;
}
示例10: InsertOrUpdate
public void InsertOrUpdate(Orders orders)
{
if (orders.Id == default(int))
{
context.Orders.Add(orders);
}
else
{
context.Entry(orders).State = EntityState.Modified;
}
}
示例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));
}
示例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");
//}
}
示例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");
}
}
示例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();
}
示例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);
}