Ejemplo n.º 1
0
 public RepairOrderRepository(RepairOrderProjectRepository repairOrderProjectRepository,
                              RepairOrderProductRepository repairOrderProductRepository,
                              CustomerRepository customerRepository,
                              EmployeeRepository employeeRepository,
                              ProductStockRecordRepository productStockRecordRepository)
 {
     this.RepairOrderProjectRepository = repairOrderProjectRepository;
     this.RepairOrderProductRepository = repairOrderProductRepository;
     this.CustomerRepository           = customerRepository;
     this.EmployeeRepository           = employeeRepository;
     this.ProductStockRecordRepository = productStockRecordRepository;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取维修单,并填充关联数据
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public override RepairOrder GetModel(Guid Id)
        {
            using (var context = DbContext.Open())
            {
                var model = context.SingleById <RepairOrder>(Id);
                if (model == null)
                {
                    return(null);
                }

                model.ProjectList = RepairOrderProjectRepository.Find(model.Id);
                model.ProductList = RepairOrderProductRepository.Find(model.Id);
                model.Customer    = CustomerRepository.Get(model.CustomerId);
                model.ReceptionBy = EmployeeRepository.Get(model.ReceptionById);

                return(model);
            }
        }