Пример #1
0
        private void Fixupordermaster(ordermaster previousValue)
        {
            if (previousValue != null && previousValue.orderchilds.Contains(this))
            {
                previousValue.orderchilds.Remove(this);
            }

            if (ordermaster != null)
            {
                if (!ordermaster.orderchilds.Contains(this))
                {
                    ordermaster.orderchilds.Add(this);
                }
                if (order_id != ordermaster.id)
                {
                    order_id = ordermaster.id;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Update Order details in database
        /// </summary>
        /// <param name="orderDetails">ordermaster object to be updated</param>
        /// <returns>returns boolean value indicating if the records are updated in database</returns>
        bool IOrderService.UpdateOrderDetail(OrderMasterDTO orderDetail)
        {
            bool isRecordUpdated = false;
            ordermaster orderEntity = new ordermaster();
            ObjectMapper.Map(orderDetail, orderEntity);

            isRecordUpdated = OrderMasterRepository.Update(orderEntity);

            foreach (orderchild item in orderEntity.orderchilds)
            {
                if (item.order_id == 0)
                {
                    item.order_id = orderEntity.id;
                    isRecordUpdated = OrderChildRepository.Save(item);
                }
                else
                {
                    isRecordUpdated = OrderChildRepository.Update(item);
                }
            }
            return OrderMasterRepository.Update(orderEntity);
        }
Пример #3
0
 /// <summary>
 /// Save Order details in database
 /// </summary>
 /// <param name="orderDetails">ordermaster object to be saved</param>
 /// <returns>returns boolean value indicating if the records are saved in database</returns>
 bool IOrderService.SaveOrderDetail(OrderMasterDTO orderDetail)
 {
     ordermaster orderEntity = new ordermaster();
     ObjectMapper.Map(orderDetail, orderEntity);
     return OrderMasterRepository.Save(orderEntity);
 }
Пример #4
0
        private void Fixupordermaster(ordermaster previousValue)
        {
            if (previousValue != null && previousValue.orderchilds.Contains(this))
            {
                previousValue.orderchilds.Remove(this);
            }

            if (ordermaster != null)
            {
                if (!ordermaster.orderchilds.Contains(this))
                {
                    ordermaster.orderchilds.Add(this);
                }
                if (order_id != ordermaster.id)
                {
                    order_id = ordermaster.id;
                }
            }
        }