Example #1
0
        /// <summary>
        /// Import data from privat 24. Called when the timer is triggered.
        /// </summary>
        /// <param name="o">Object from timer.</param>
        private void ImportDataFromBank(object o)
        {
            TimerWithIntervalViewModel thisTimer = (TimerWithIntervalViewModel)o;

            UpdateDate(thisTimer.IntervalViewModel.OrganizationId);
            int intervalInMinutes = (int)ConvertToMinutes(thisTimer.IntervalViewModel.Interval);

            PrivatImporter.Import(thisTimer.IntervalViewModel.OrganizationId, intervalInMinutes);
        }
Example #2
0
 public async Task <string> ImportWithDates(PrivatImportViewModel model)
 {
     try
     {
         return(await PrivatImporter.Import(model.Card, model.IdMerchant.ToString(), model.Password, Convert.ToDateTime(model.DataFrom), Convert.ToDateTime(model.DataTo)));
     }
     catch (Exception ex)
     {
         throw new BusinessLogicException(ex.Message, ex);
     }
 }
Example #3
0
 public async Task <string> ImportFromPrivat(int orgAccountId)
 {
     try
     {
         var bancAccount = _unitOfWork.OrganizationAccountRepository.GetOrgAccountById(orgAccountId).BankAccount;
         var interval    = _unitOfWork.ImportIntervalRepository.GetByOrgId(bancAccount.OrgId);
         var result      = PrivatImporter.Import(bancAccount.CardNumber, bancAccount.ExtractMerchantId.ToString(), bancAccount.ExtractMerchantPassword, interval.LastUpdateDate.Value);
         return(await result);
     }
     catch (Exception ex)
     {
         throw new BusinessLogicException(ex.Message, ex);
     }
 }