Exemplo n.º 1
0
 public void UpdateOrderInfo(OrderBO order)
 {
     orderDao.UpdateOrderInfo(order);
 }
Exemplo n.º 2
0
 public OrderBO InsertOrderInfo(OrderBO order)
 {
     return orderDao.InsertOrderInfo(order);
 }
Exemplo n.º 3
0
        public OrderBO InsertOrderInfo(OrderBO order)
        {
            using (var context = new InThuDoEntities())
            {
                Order entity = new Order() {
                    Deposit = order.Deposit,
                    DepositTypeId = order.DepositTypeId,
                    ShippingMethodId = order.ShippingMethodId,
                    OrderDate = order.OrderDate,
                    CustomerId = order.CustomerId,
                    UserId = order.BusinessManId,
                    CreatedBy = order.CreatedBy,
                    CreatedDate = order.CreatedDate,
                    LastEditedBy = order.LastEditedBy,
                    LastEditedDate = order.LastEditedDate,
                    ExpectedCompleteDate = order.ExpectedCompleteDate,
                    Note = order.Note,
                    DeliveryAddress = order.DeliveryAddress,
                    ApprovedByCustomer = order.ApprovedByCustomer,
                    ApprovedDate = order.ApprovedDate,
                    VAT = order.VAT
                };
                context.Orders.Add(entity);
                context.Entry(entity).State = System.Data.EntityState.Added;
                context.SaveChanges();

                order.OrderId = entity.OrderId;
                return order;
            }
        }
Exemplo n.º 4
0
        public void UpdateOrderInfo(OrderBO order)
        {
            using (var context = new InThuDoEntities())
            {
                Order entity = context.Orders.Where(o => o.OrderId == order.OrderId).FirstOrDefault();
                entity.OrderDate = order.OrderDate;
                entity.Deposit = order.Deposit;
                entity.DepositTypeId = order.DepositTypeId;
                entity.ShippingMethodId = order.ShippingMethodId;
                entity.CustomerId = order.CustomerId;
                entity.UserId = order.BusinessManId;
                entity.LastEditedBy = order.LastEditedBy;
                entity.LastEditedDate = order.LastEditedDate;
                entity.ExpectedCompleteDate = order.ExpectedCompleteDate;
                entity.Note = order.Note;
                entity.DeliveryAddress = order.DeliveryAddress;
                entity.ApprovedByCustomer = order.ApprovedByCustomer;
                entity.ApprovedDate = order.ApprovedDate;
                entity.VAT = order.VAT;
                entity.Note = order.Note;

                context.Entry(entity).State = System.Data.EntityState.Modified;
                context.SaveChanges();
            }
        }
Exemplo n.º 5
0
        public decimal GetOrderTotal(OrderBO order)
        {
            using (var context = new InThuDoEntities())
            {
                var orderDetail = from od in context.OrderItems
                                  where od.OrderId == order.OrderId
                                  && (od.Deleted == false || od.Deleted == null)
                                  select od;

                decimal orderTotal = 0;
                if (orderDetail != null)
                {
                    foreach (OrderItem oi in orderDetail.ToList())
                    {
                        orderTotal += oi.Quantity * oi.Price;
                    }

                }
                return orderTotal;
            }
        }