public PaymentType GetProduct(int paymentTypeId)
        {
            var repo        = new PaymentTypeRepository();
            var paymentType = repo.GetPaymentType(paymentTypeId);

            return(paymentType);
        }
        public List <TransactionModel> GetTransactions(Guid accountId)
        {
            var returnList = new List <Models.TransactionModel>();

            if (OptionsBuilder == null)
            {
                throw new Exception("Service is not started");
            }
            ITransactionRepository repo      = new TransactionRepository();
            var accountTranactions           = repo.GetTransactions(accountId, OptionsBuilder);
            ICategoryRepository    catRepo   = new CategoryRepository();
            IPaymentTypeRepository pTypeRepo = new PaymentTypeRepository();

            for (int i = 0; i < accountTranactions.Count; i++)
            {
                var returnValue = new TransactionModel();
                returnValue.IsDeposit       = accountTranactions[i].IsDeposit;
                returnValue.CategoryName    = catRepo.GetCategory(accountTranactions[i].CategoryId, OptionsBuilder).CategoryName;
                returnValue.CategoryId      = accountTranactions[i].CategoryId;
                returnValue.PaymentTypeName = pTypeRepo.GetPaymentType(accountTranactions[i].PaymentTypeId, OptionsBuilder).Name;
                returnValue.PaymentTypeId   = accountTranactions[i].PaymentTypeId;
                returnValue.AccountId       = accountTranactions[i].AccountId;
                returnValue.Amount          = accountTranactions[i].Amount;
                returnValue.Description     = accountTranactions[i].Description;
                returnValue.Id = accountTranactions[i].Id;
                returnValue.TransactionDate = accountTranactions[i].TransactionDate;

                returnList.Add(returnValue);
            }

            return(returnList);
        }
예제 #3
0
 public static bool DeletePaymentType(int id)
 {
     if (PaymentTypeRepository.GetPaymentType(id) != null)
     {
         PaymentTypeRepository.DeletePaymentType(id);
         return(true);
     }
     return(false);
 }
예제 #4
0
 public static bool UpdatePaymentType(int id, string type)
 {
     if (PaymentTypeRepository.GetPaymentType(id) != null)
     {
         PaymentTypeRepository.UpdatePaymentType(id, type);
         return(true);
     }
     return(false);
 }
예제 #5
0
 public PaymentTypeObject GetPaymentType(long paymentTypeAccountId)
 {
     try
     {
         return(_paymentTypeRepository.GetPaymentType(paymentTypeAccountId));
     }
     catch (Exception ex)
     {
         ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
         return(new PaymentTypeObject());
     }
 }
 public static PaymentType GetPaymentTypeHandler(int id)
 {
     return(PaymentTypeRepository.GetPaymentType(id));
 }
예제 #7
0
 public PaymentType GetPaymentType(int id)
 {
     return(_repo.GetPaymentType(id));
 }
        public PaymentType Get(int paymentTypeId)
        {
            var repo = new PaymentTypeRepository();

            return(repo.GetPaymentType(paymentTypeId));
        }