Ejemplo n.º 1
0
 public async Task CreateOrEdit(CreateOrEditAccountPaymentsDto input)
 {
     if (!input.Id.HasValue)
     {
         await Create(input);
     }
     else if (input.Id == 0)
     {
         await Create(input);
     }
     else if (input.Id > 0)
     {
         await Update(input);
     }
 }
Ejemplo n.º 2
0
        protected virtual async Task Create(CreateOrEditAccountPaymentsDto input)
        {
            _unitOfWorkManager.Current.DisableFilter(AbpDataFilters.MayHaveTenant);
            var accountPayments = ObjectMapper.Map <AccountPayment>(input);

            if (AbpSession.TenantId != null)
            {
                accountPayments.TenantId = (int)AbpSession.TenantId;
            }
            await _accountPaymentsRepository.InsertAsync(accountPayments);

            if (input.ConfirmReservation)
            {
                var tblReservation = _reservationsRepository.GetAll().Where(x => x.Id == input.ReservationId).FirstOrDefault();
                tblReservation.ReservationLocked = true;
                tblReservation.ReservationStatus = 5;
                await _reservationsRepository.UpdateAsync(tblReservation);
            }
        }
Ejemplo n.º 3
0
        protected virtual async Task Update(CreateOrEditAccountPaymentsDto input)
        {
            var accountPayments = await _accountPaymentsRepository.FirstOrDefaultAsync((int)input.Id);

            ObjectMapper.Map(input, accountPayments);
        }