Exemplo n.º 1
0
        public async Task <ServiceResponce <List <GetBillingandDueDayDto> > > AddBillingandDueDay(AddBillingandDueDayDto newbasecurrency)
        {
            ServiceResponce <List <GetBillingandDueDayDto> > serviceResponse = new ServiceResponce <List <GetBillingandDueDayDto> >();
            BillingandDueDay basecurrency = _mapper.Map <BillingandDueDay>(newbasecurrency);

            basecurrency.IsActive  = true;
            basecurrency.CreatedOn = DateTime.Now;
            await _dataContext.BillingandDueDays.AddAsync(basecurrency);

            await _dataContext.SaveChangesAsync();

            serviceResponse.Data = await _dataContext.BillingandDueDays.Where(x => x.IsActive == true).Select(c => _mapper.Map <GetBillingandDueDayDto>(c)).ToListAsync();


            return(serviceResponse);
        }
Exemplo n.º 2
0
 public async Task <ActionResult> AddBillingandDueDay(AddBillingandDueDayDto newbillinganddueday)
 {
     return(Ok(await _BillingandDueDayService.AddBillingandDueDay(newbillinganddueday)));
 }