public PurchaseOrderRepository(
     PurchaseOrderProductRepository purchaseOrderProductRepository,
     EmployeeRepository employeeRepository,
     SupplierRepository supplierRepository,
     ProductStockRecordRepository productStockRecordRepository,
     ProductRepository productRepository)
 {
     this.PurchaseOrderProductRepository = purchaseOrderProductRepository;
     this.EmployeeRepository             = employeeRepository;
     this.SupplierRepository             = supplierRepository;
     this.ProductStockRecordRepository   = productStockRecordRepository;
     this.ProductRepository = productRepository;
 }
        /// <summary>
        /// 获取采购单,填充关联对象
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public override PurchaseOrder GetModel(Guid Id)
        {
            using (var context = DbContext.Open())
            {
                var model = context.SingleById <PurchaseOrder>(Id);
                if (model == null)
                {
                    return(null);
                }

                model.ProductList = PurchaseOrderProductRepository.Find(model.Id);
                model.PurchaseBy  = EmployeeRepository.Get(model.PurchaseById);
                model.Supplier    = SupplierRepository.Get(model.SupplierId);
                return(model);
            }
        }