예제 #1
0
        /// <summary>
        ///     插入新订单行
        /// </summary>
        /// <param name="order">订单</param>
        /// <param name="dto">订单DTO</param>
        /// <param name="line">订单行DTO</param>
        /// <param name="importType">引进方式</param>
        /// <param name="supplierId">供应商ID</param>
        private void InsertOrderLine(BFEPurchaseOrder order, BFEPurchaseOrderDTO dto,
            BFEPurchaseOrderLineDTO line, ActionCategory importType, int supplierId)
        {
            // 获取飞机物料机型
            var material =
                _materialRepository.GetFiltered(m => m.Id == line.BFEMaterialId)
                    .OfType<BFEMaterial>()
                    .FirstOrDefault();
            if (material == null)
            {
                throw new ArgumentException("未能获取飞机物料!");
            }

            // 添加订单行
            var orderLine = order.AddNewBFEPurchaseOrderLine(line.UnitPrice, line.Amount, line.Discount,
                line.EstimateDeliveryDate);
            orderLine.SetBFEMaterial(line.BFEMaterialId);
        }
예제 #2
0
        /// <summary>
        ///     创建BFE购买订单
        /// </summary>
        /// <param name="version">版本</param>
        /// <param name="operatorName">经办人</param>
        /// <param name="orderDate">订单日期</param>
        /// <returns>BFE购买订单</returns>
        public static BFEPurchaseOrder CreateBFEPurchaseOrder(int version,
            string operatorName, DateTime orderDate)
        {
            var bfePurchaseOrder = new BFEPurchaseOrder
            {
                Version = version,
                OperatorName = operatorName,
                CreateDate = DateTime.Now,
                OrderDate = orderDate,
                IsValid = true
            };

            return bfePurchaseOrder;
        }