Example #1
0
 public TicketAssign(string name,string idcard,OrderDetail detail,int amount)
     : this()
 {
     this.Name = name;
     this.OrderDetail = detail;
     this.Amount = amount;
     this.IdCard = idcard;
     this.TicketCode = detail.TicketPrice.Ticket.ProductCode;
 }
Example #2
0
        private void UpdateProductList(Order order)
        {
            var biz = new OrderDetailBiz();
            biz.RemoveItemsByOrderId(order.Id);

            for (int i = 0; i < dataGridView.RowCount - 1; i++)
            {
                var entity = dataGridView.Rows[i].DataBoundItem as SearchProduct;
                if (entity != null && entity.Total > 0)
                {
                    var detail = new OrderDetail();
                    detail.OrderId = order.Id;
                    detail.ProductId = entity.Id;
                    detail.Quantity = entity.Quantity.Value;
                    detail.ProductPrice = entity.Price.Value;
                    detail.Discount = entity.Discount;
                    detail.Total = Convert.ToDecimal(entity.TotalValue);
                    detail.ProductActualPrice = entity.ActualPrice;
                    biz.SaveItem(detail);
                }
            }

            for (int i = 0; i < dataGridViewLD.RowCount - 1; i++)
            {
                var entity = dataGridViewLD.Rows[i].DataBoundItem as SearchProductLD;
                if (entity != null && entity.Total > 0)
                {
                    var detail = new OrderDetail();
                    detail.OrderId = order.Id;
                    detail.ProductLdId = entity.Id;
                    detail.Quantity = entity.Quantity.Value;
                    detail.ProductPrice = entity.Price.Value;
                    detail.Discount = entity.Discount;
                    detail.Total = Convert.ToDecimal(entity.TotalValue);
                    detail.ProductActualPrice = entity.ActualPrice;
                    biz.SaveItem(detail);
                }
            }
        }