示例#1
0
文件: BillService.cs 项目: mgce/Billy
        private async Task <Supplier> GetSupplierByName(string name, string userId)
        {
            var supplier = await _supplierRepository.GetByName(name, userId);

            if (supplier == null)
            {
                supplier = _supplierFactory.Create(name, userId);
                await _supplierRepository.Add(supplier);
            }

            return(supplier);
        }
示例#2
0
        public override void Execute()
        {
            TypedResult = new AddSupplierResult();

            CheckIfSupplierExist();

            var supplier = supplierFactory.Create();

            supplier.Name = SupplierName;

            suppliersRepository.Add(supplier);

            TypedResult.Supplier = supplier;

            base.Execute();
        }
示例#3
0
 public async Task Add(AddSupplierDto dto)
 {
     var supplier = _supplierFactory.Create(dto.Name, dto.UserId);
     await _supplierRepository.Add(supplier);
 }