Пример #1
0
        public Order CreateNewOrder(Order order)
        {
            DAL.Entity.Order ord = new DAL.Entity.Order
            {
                Id         = order.Id,
                ClientId   = order.ClientId,
                PeymentId  = order.PeymentId,
                DeliveryId = order.DeliveryId,
                Comment    = order.Comment
            };
            if (ord != null)
            {
                ord = _dal.CreateNewOrder(ord);
                BLL.Models.Order ord_new = new BLL.Models.Order
                {
                    Id         = ord.Id,
                    ClientId   = ord.ClientId,
                    PeymentId  = ord.PeymentId,
                    DeliveryId = ord.DeliveryId,
                    Comment    = ord.Comment
                };

                return(ord_new);
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
        public Order GetOrderById(int id)
        {
            DAL.Entity.Order order       = _dal.GetOrderById(id);
            BLL.Models.Order orderResult = null;

            orderResult = new BLL.Models.Order
            {
                Id         = order.Id,
                ClientId   = order.ClientId,
                PeymentId  = order.PeymentId,
                DeliveryId = order.DeliveryId,
                Comment    = order.Comment
            };
            return(orderResult);
        }
Пример #3
0
        public bool UpdateOrder(Order order)
        {
            DAL.Entity.Order ord_original = _dal.GetOrderById(order.Id);

            if (ord_original != null)
            {
                DAL.Entity.Order ord_mod = ord_original;

                ord_mod.ClientId   = order.ClientId;
                ord_mod.PeymentId  = order.PeymentId;
                ord_mod.DeliveryId = order.DeliveryId;
                ord_mod.Comment    = order.Comment;

                _dal.UpdateOrder(ord_original, ord_mod);
                return(true);
            }
            else
            {
                return(false);
            }
        }