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

C# OrderDetail类代码示例

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

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



OrderDetail类属于命名空间,在下文中一共展示了OrderDetail类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:7,代码来源:OrderDetail.cs


示例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;
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:27,代码来源:OrderDetail.cs


示例3: LoadReportForEditResponse

		public LoadReportForEditResponse(ReportDetail report, int reportPartIndex, OrderDetail order, List<EnumValueInfo> priorityChoices)
    	{
    		Report = report;
    		ReportPartIndex = reportPartIndex;
    		Order = order;
			PriorityChoices = priorityChoices;
    	}
开发者ID:nhannd,项目名称:Xian,代码行数:7,代码来源:LoadReportForEditResponse.cs


示例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;
        }
开发者ID:cj8397,项目名称:2hourVer2,代码行数:26,代码来源:OrderRepo.cs


示例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;
        }
开发者ID:Kraismir,项目名称:FinalProject,代码行数:29,代码来源:ShoppingCart.cs


示例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 });
        }
开发者ID:dtafe,项目名称:ShopOnline,代码行数:30,代码来源:OrderController.cs


示例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();
        }
开发者ID:phiree,项目名称:testttt,代码行数:31,代码来源:CheckoutTEst.cs


示例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);
		}
开发者ID:nishanil,项目名称:MyMenu,代码行数:29,代码来源:CheckoutViewModel.cs


示例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");
        }
开发者ID:phamxuanlu,项目名称:MVC4-MobileStoreWeb,代码行数:31,代码来源:CheckoutController.cs


示例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;
        }
开发者ID:shanjee,项目名称:GitHub-Cart,代码行数:35,代码来源:ShoppingCart.cs


示例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");
 }
开发者ID:SamYao779,项目名称:DemoCodeProjectMVC5,代码行数:26,代码来源:OrderController.cs


示例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
        }
开发者ID:phiree,项目名称:testttt,代码行数:32,代码来源:BLLQZTicketSeller.cs


示例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();
        }
开发者ID:dzstoever,项目名称:ZenFacades,代码行数:12,代码来源:Mapper.cs


示例14: OrderDetailModel

 public OrderDetailModel(OrderDetail detail)
     : this()
 {
     if (detail != null)
         ModelObjectHelper.CopyObject(detail, this);
     UrlName = StringHelper.VNSignedToLowerUnsigned(ItemName);
 }
开发者ID:meothailand,项目名称:GKNMShop,代码行数:7,代码来源:OrderItemModel.cs


示例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>();

            }
        }
开发者ID:haticenur,项目名称:ETicaretKitapci,代码行数:31,代码来源:mycart.aspx.cs


示例16: Test_AddOrderDetails

 public void Test_AddOrderDetails()
 {
     IOC.RegisterComponents();
       Order order = Repository<Order>.All(this).First();
       Product product = Repository<Product>.All(this).First();
       OrderDetail ordDetail = new OrderDetail() { Discount = 0, Quantity = 1, ParentOrder = order, ParentProduct = product };
       Repository<OrderDetail>.Save(ordDetail, this);
 }
开发者ID:iliasashaikh,项目名称:Orderprocessing,代码行数:8,代码来源:OrderProcessTestForIOC.cs


示例17: AssembleOrderDetail

 public static OrderDetail AssembleOrderDetail(DomainModel.OrderDetail detail)
 {
     OrderDetail dto = new OrderDetail();
     dto.ProductId = (int)detail.Product.Id[0];
     dto.Quantity = detail.Quantity;
     dto.UnitPrice = detail.UnitPrice;
     dto.Timestamp = detail.Timestamp.Value;
     return dto;
 }
开发者ID:eglimi,项目名称:storm,代码行数:9,代码来源:DTOAssembler.cs


示例18: GetLineTotalCalculatesTotal

        public void GetLineTotalCalculatesTotal()
        {
            short quantity = 3;
            decimal unitPrice = 12.23m;
            OrderDetail detail = new OrderDetail(1, 1, quantity, unitPrice);

            decimal total = detail.LineTotal;

            Assert.AreEqual((decimal)(quantity * unitPrice), total);
        }
开发者ID:riseandcode,项目名称:open-wscf-2010,代码行数:10,代码来源:Order_DetailFixture.cs


示例19: FromDataTransferObject

 /// <summary>
 /// Maps order detail data transfer object to order model object.
 /// </summary>
 /// <param name="orderDetail">Order detail data transfer object.</param>
 /// <returns>Orderdetail model object.</returns>
 internal static OrderDetailModel FromDataTransferObject(OrderDetail orderDetail)
 {
     return new OrderDetailModel
     {
         ProductName = orderDetail.ProductName,
         Discount = orderDetail.Discount,
         Quantity = orderDetail.Quantity,
         UnitPrice = orderDetail.UnitPrice,
         Version = orderDetail.Version
     };
 }
开发者ID:ronymaychan,项目名称:demos,代码行数:16,代码来源:Mapper.cs


示例20: GetOrderTotalCalculatesTotal

        public void GetOrderTotalCalculatesTotal()
        {
            Order order = new Order();
            OrderDetail line1 = new OrderDetail(1, 1, 2, 2.35m);
            OrderDetail line2 = new OrderDetail(1, 1, 1, 1.09m);
            order.Details.Add(line1);
            order.Details.Add(line2);

            decimal total = order.OrderTotal;

            Assert.AreEqual((decimal)(line1.LineTotal + line2.LineTotal), total);
        }
开发者ID:riseandcode,项目名称:open-wscf-2010,代码行数:12,代码来源:OrderFixture.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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