예제 #1
0
 public async Task CreateOrEdit(CreateOrEditVendorDto input)
 {
     if (input.Id == null)
     {
         await Create(input);
     }
     else
     {
         await Update(input);
     }
 }
예제 #2
0
        protected virtual async Task Create(CreateOrEditVendorDto input)
        {
            var vendor = ObjectMapper.Map <Vendor>(input);


            if (AbpSession.TenantId != null)
            {
                vendor.TenantId = (int?)AbpSession.TenantId;
            }


            await _vendorRepository.InsertAsync(vendor);
        }
예제 #3
0
        protected virtual async Task Update(CreateOrEditVendorDto input)
        {
            var vendor = await _vendorRepository.FirstOrDefaultAsync((int)input.Id);

            ObjectMapper.Map(input, vendor);
        }
예제 #4
0
        protected virtual async Task Create(CreateOrEditVendorDto input)
        {
            var vendor = ObjectMapper.Map <Vendor>(input);

            await _vendorRepository.InsertAsync(vendor);
        }