/// <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> /// 删除员工基础数据信息 /// </summary> /// <param name="ids">要删除的员工基础数据信息编号</param> /// <returns>业务操作结果</returns> public virtual Task <OperationResult> DeleteEmpBasedatas(params int[] ids) { Check.NotNull(ids, nameof(ids)); return(EmpBasedataRepository.DeleteAsync(ids)); }
/// <summary> /// 更新员工基础数据信息 /// </summary> /// <param name="dtos">包含更新信息的员工基础数据信息DTO信息</param> /// <returns>业务操作结果</returns> public virtual Task <OperationResult> UpdateEmpBasedatas(params EmpBasedataInputDto[] dtos) { Check.Validate <EmpBasedataInputDto, int>(dtos, nameof(dtos)); return(EmpBasedataRepository.UpdateAsync(dtos)); }
/// <summary> /// 检查员工基础数据信息是否存在 /// </summary> /// <param name="predicate">检查谓语表达式</param> /// <param name="id">更新的员工基础数据信息编号</param> /// <returns>员工基础数据信息是否存在</returns> public virtual Task <bool> CheckEmpBasedataExists(Expression <Func <EmpBasedata, bool> > predicate, int id = default(int)) { return(EmpBasedataRepository.CheckExistsAsync(predicate, id)); }