/// <summary> /// 添加出库信息 /// </summary> /// <param name="dtos">要添加的出库信息DTO信息</param> /// <returns>业务操作结果</returns> public virtual async Task <OperationResult> CreateOutStors(params OutStorInputDto[] dtos) { Check.Validate <OutStorInputDto, int>(dtos, nameof(dtos)); //通过ID获取Name foreach (OutStorInputDto dto in dtos) { MatBasedata matdb = await MatBasedataRepository.GetAsync(dto.MatId); CusBasedata cusdb = await CusBasedataRepository.GetAsync(dto.CusId); EmpBasedata empdb = await EmpBasedataRepository.GetAsync(dto.OutEmpId); dto.MatName = matdb.MatName; dto.CusName = cusdb.CusName; dto.OutEmpName = empdb.EmpName; //修改人员工作状态 empdb.EmpWorkState = true; EmpBasedataRepository.Update(empdb); } return(await OutStorRepository.InsertAsync(dtos)); }
/// <summary> /// 初始化一个<see cref="CusBasedataOutputDto"/>类型的新实例 /// </summary> public CusBasedataOutputDto(CusBasedata entity) { Id = entity.Id; CusId = entity.CusId; CusName = entity.CusName; CusPhone = entity.CusPhone; CusComStartTime = entity.CusComStartTime; CusComEndTime = entity.CusComEndTime; CusState = entity.CusState; CusRemark = entity.CusRemark; CreatedTime = entity.CreatedTime; }