本文整理汇总了C#中OrderDetail类的典型用法代码示例。如果您正苦于以下问题:C# OrderDetail类的具体用法?C# OrderDetail怎么用?C# OrderDetail使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrderDetail类属于命名空间,在下文中一共展示了OrderDetail类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetStockOutReport
public static DataView GetStockOutReport(int orderId)
{
var query = HCMIS.Repository.Queries.OrderDetail.SelectStockOutDetail(orderId);
var orderDetail = new OrderDetail();
orderDetail.LoadFromRawSql(query);
return orderDetail.DefaultView;
}
示例2: GenerateOrderDetail
public static OrderDetail GenerateOrderDetail(int unitId, int activityId, decimal pack, int orderId,
int qtyPerPack, int itemId)
{
var ord = new OrderDetail();
ord.LoadByItemUnit(orderId,itemId,unitId,activityId);
if (ord.RowCount == 0)
{
ord.AddNew();
ord.OrderID = orderId;
ord.ItemID = itemId;
ord.UnitID = unitId;
ord.StoreID = activityId;
ord.Pack = pack;
ord.QtyPerPack = qtyPerPack;
ord.Quantity = pack*qtyPerPack;
ord.ApprovedQuantity = pack*qtyPerPack;
}
else
{
ord.Pack += pack;
ord.Quantity += pack;
ord.ApprovedQuantity += pack*qtyPerPack;
}
ord.Save();
return ord;
}
示例3: LoadReportForEditResponse
public LoadReportForEditResponse(ReportDetail report, int reportPartIndex, OrderDetail order, List<EnumValueInfo> priorityChoices)
{
Report = report;
ReportPartIndex = reportPartIndex;
Order = order;
PriorityChoices = priorityChoices;
}
示例4: GetOrderDetail
//Get order details
public OrderDetail GetOrderDetail()
{
mergedEntities db = new mergedEntities();
OrderDetails repo = new OrderDetails();
OrderDetail order = new OrderDetail();
var query =
from a in db.OrderDetails
where (a.orderNumber == repo.OrderNumber)
select new
{
OrderNumber = a.orderNumber,
OrderDate = a.orderDate,
Delivery = a.deliveryStatus,
};
foreach (var item in query)
{
order.orderNumber = item.OrderNumber;
order.orderDate = item.OrderDate;
order.deliveryStatus = item.Delivery;
}
return order;
}
示例5: CreateOrder
public int CreateOrder(Order order)
{
decimal orderTotal = 0;
var cartItems = GetCartItems();
foreach (var item in cartItems)
{
var orderDetail = new OrderDetail
{
CarID = item.CarID,
OrderID = order.OrderID,
UnitPrice = item.Car.Price,
Quantity = item.Count
};
orderTotal += (item.Count*item.Car.Price);
storeDB.OrderDetails.Add(orderDetail);
}
order.Total = orderTotal;
storeDB.SaveChanges();
EmptyCart();
return order.OrderID;
}
示例6: Purchase
public ActionResult Purchase(Order model)
{
db.Orders.Add(model);
var cart = ShoppingCart.Cart;
foreach (var p in cart.Items)
{
var d = new OrderDetail
{
Order = model,
ProductId = p.Id,
UnitPrice = p.UnitPrice,
Discount = p.Discount,
Quantity = p.Quantity
};
db.OrderDetails.Add(d);
}
db.SaveChanges();
// Thanh toán trực tuyến
//var api = new WebApiClient<AccountInfo>();
//var data = new AccountInfo
//{
// Id = Request["BankAccount"],
// Balance = cart.Total
//};
//api.Put("api/Bank/nn", data);
return RedirectToAction("Detail", new { id = model.Id });
}
示例7: TestGetOrder
public void TestGetOrder()
{
Checkout checkout = new Checkout();
// checkout.BuerId =new Guid("2D3455F8-C7B5-4949-814A-A02A00DE271E");
checkout.PriceType = PriceType.PayOnline;
List<OrderDetail> details = new List<OrderDetail>();
OrderDetail detail = new OrderDetail();
detail.Quantity =5;
Ticket t = new BLLTicket().GetTicket(1);
TicketPrice tp = t.TicketPrice.Single<TicketPrice>(x => x.PriceType == PriceType.PayOnline);
detail.TicketPrice = tp;
for (int i = 0; i < detail.Quantity; i++)
{
TicketAssign ta = new TicketAssign();
ta.IdCard = "idcard1";
ta.IsUsed = false;
ta.Name = "namei";
detail.TicketAssignList.Add(ta);
}
// new BLLOrderDetail().SaveOrUpdateOrderDetail(detail);
details.Add(detail);
checkout.Details = details;
checkout.MakeOrder();
}
示例8: PopulateOrders
void PopulateOrders ()
{
if (App.CheckoutItems == null) {
return;
}
var foodItems = App.CheckoutItems.GroupBy (p => p.Id);
foreach (var item in foodItems) {
var food = item.FirstOrDefault ();
if (food == null)
continue;
var order = new OrderDetail {
FoodId = food.Id,
FoodName = food.Name,
Quantity = item.Count (),
SellingPrice = food.PricePerQty,
};
CheckoutItems.Add (new OrderDetailsViewModel (order, this));
}
if (CheckoutItems.Count <= 0) {
return;
}
TotalPrice = CheckoutItems.Sum (p => p.Details.TotalPrice);
}
示例9: SaveBill
public ActionResult SaveBill(FormCollection frmData)
{
Orders od = new Orders();
Cart<Product> cart = HttpContext.Session["Cart"] as Cart<Product>;
od.OrdersID = orders.NextID();
od.AccountID = 1;
od.Adress = frmData["txtAddess"];
od.OrderDate = DateTime.Now;
od.CMND = frmData["txtPassport"];
od.Email = frmData["txtEmail"];
od.FirstName = frmData["txtFName"];
od.LastName = frmData["txtLName"];
od.Note = frmData["txtNote"];
od.PhoneNumber = frmData["txtPhone"];
od.ReceiveAddress = frmData["txtReceive"];
od.Status = (int)OrderStatus.Pending;
od.TotalAmount = cart.CalculateAmount();
for (int i = 0; i < cart.ListItems.Count;i++ )
{
OrderDetail ordl = new OrderDetail();
ordl.OrderDetailID = orderDetail.NextID();
ordl.OrdersID = od.OrdersID;
ordl.ProductID = cart.ListItems[i].Item.ProductID;
ordl.Quantity = cart.ListItems[i].Quantity;
ordl.Price = cart.ListItems[i].Item.ListedPrice*cart.ListItems[i].Quantity;
_dObject.Insert(ordl);
}
_dObject.Insert(od);
return Json("ok");
}
示例10: CreateOrder
public int CreateOrder(Order order)
{
decimal orderTotal = 0;
var cartItems = GetCartItems();
// Iterate over the items in the cart, adding the order details for each
foreach (var item in cartItems)
{
var orderDetail = new OrderDetail
{
ProductId = item.ProductId,
OrderId = order.OrderId,
UnitPrice = item.Product.Price,
Quantity = item.Count
};
// Set the order total of the shopping cart
orderTotal += (item.Count * item.Product.Price);
storeDB.OrderDetails.Add(orderDetail);
}
// Set the order's total to the orderTotal count
order.Total = orderTotal;
// Save the order
storeDB.SaveChanges();
// Empty the shopping cart
EmptyCart();
// Return the OrderId as the confirmation number
return order.OrderId;
}
示例11: Purchase
public ActionResult Purchase(Order model)
{
try
{
db.Orders.Add(model);
foreach (var p in ProjectMVC5.Models.ShoppingCart.Cart.Items)
{
var detail = new OrderDetail()
{
Order = model,
ProductId = p.Id,
Quantity = p.Quantity,
UnitPrice = p.Price,
};
db.OrderDetails.Add(detail);
}
db.SaveChanges();
ProjectMVC5.Models.ShoppingCart.Cart.clear();
return RedirectToAction("OrderList");
}
catch
{
ModelState.AddModelError("", "Đặt hàng lỗi");
}
return View("Checkout");
}
示例12: BuildOrderForQZ
public Order BuildOrderForQZ(TourMembership member, string assignName, string idcardno, Ticket currentTicket, int amount, string parnterName)
{
#region 开始出票
//1 为身份证号创建一个用户名
TicketAssign ta = new TicketAssign();
ta.IdCard = idcardno;
ta.IsUsed = false;
ta.Name = assignName;
OrderDetail orderdetail = new OrderDetail();
orderdetail.Quantity = amount;
orderdetail.Remark = "衢州新春门票派送活动自动创建订单,请票来源:" + parnterName;
orderdetail.TicketAssignList.Add(ta);
TicketPrice ticketPrice = currentTicket.GetTicketPrice(PriceType.PayOnline);
orderdetail.TicketPrice = ticketPrice;
Order order = new Order();
order.BuyTime = DateTime.Now;
order.IsPaid = true;
order.TourMembership = member;
order.OrderDetail.Add(orderdetail);
order.PayTime = DateTime.Now;
order.PriceType = PriceType.PayOnline;
order.PayTime = DateTime.Now;
order.TradeNo = "QZFREE";
return order;
#endregion
}
示例13: FromDataTransferObjects
/// <summary>
/// Maps arrary of order detail data transfer objects to list of order details models.
/// </summary>
/// <param name="orderDetails">Array of order detail data transfer objects.</param>
/// <returns>List of order detail models.</returns>
internal static IList<OrderDetailModel> FromDataTransferObjects(OrderDetail[] orderDetails)
{
if (orderDetails == null)
return null;
return orderDetails.Select(FromDataTransferObject).ToList();
}
示例14: OrderDetailModel
public OrderDetailModel(OrderDetail detail)
: this()
{
if (detail != null)
ModelObjectHelper.CopyObject(detail, this);
UrlName = StringHelper.VNSignedToLowerUnsigned(ItemName);
}
示例15: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
Order o = new Order();
o.OrderNo = CreateOrderNo();// rastgele oluştur
o.UserId = new Guid(Membership.GetUser().ProviderUserKey.ToString());
o.Date = DateTime.Now;
OrderBLL ob = new OrderBLL();
ob.Add(o);
ProductBLL pb = new ProductBLL();
foreach (var p in Helper.Sepet)
{
OrderDetail od = new OrderDetail();
od.OrderId = o.Id;
od.ProductId = p.Id;
od.Quantity = p.Quantity;
OrderDetailBLL obll = new OrderDetailBLL();
obll.Add(od);
Product pr = pb.Get(x => x.Id == p.Id).FirstOrDefault();
pr.Stock -= p.Quantity;
pb.Update(pr);
Helper.Sepet = new List<ProductDTO>();
}
}