Example #1
0
        /// <summary>
        /// 添加入库信息
        /// </summary>
        /// <param name="dtos">要添加的入库信息DTO信息</param>
        /// <returns>业务操作结果</returns>
        public virtual async Task <OperationResult> CreateInStors(params InStorInputDto[] dtos)
        {
            Check.Validate <InStorInputDto, int>(dtos, nameof(dtos));
            //通过ID新增Name

            foreach (InStorInputDto dto in dtos)
            {
                MatBasedata matdb = await MatBasedataRepository.GetAsync(dto.MatId);

                SupBasedata supdb = await SupBasedataRepository.GetAsync(dto.SupId);

                dto.MatName = matdb.MatName;
                dto.SupName = supdb.SupName;
            }

            return(await InStorRepository.InsertAsync(dtos));
        }
 /// <summary>
 /// 删除供应商基础数据信息
 /// </summary>
 /// <param name="ids">要删除的供应商基础数据信息编号</param>
 /// <returns>业务操作结果</returns>
 public virtual Task <OperationResult> DeleteSupBasedatas(params int[] ids)
 {
     Check.NotNull(ids, nameof(ids));
     return(SupBasedataRepository.DeleteAsync(ids));
 }
 /// <summary>
 /// 更新供应商基础数据信息
 /// </summary>
 /// <param name="dtos">包含更新信息的供应商基础数据信息DTO信息</param>
 /// <returns>业务操作结果</returns>
 public virtual Task <OperationResult> UpdateSupBasedatas(params SupBasedataInputDto[] dtos)
 {
     Check.Validate <SupBasedataInputDto, int>(dtos, nameof(dtos));
     return(SupBasedataRepository.UpdateAsync(dtos));
 }
 /// <summary>
 /// 检查供应商基础数据信息是否存在
 /// </summary>
 /// <param name="predicate">检查谓语表达式</param>
 /// <param name="id">更新的供应商基础数据信息编号</param>
 /// <returns>供应商基础数据信息是否存在</returns>
 public virtual Task <bool> CheckSupBasedataExists(Expression <Func <SupBasedata, bool> > predicate, int id = default(int))
 {
     return(SupBasedataRepository.CheckExistsAsync(predicate, id));
 }