Beispiel #1
0
        public bool AddMoCreditsTransaction(long to, long fromid, double amount, TransferType type, long?linkedId)
        {
            var matchingPaymentType = _paymentTypesService.GetPaymentType(type);

            if (matchingPaymentType != null)
            {
                var creditTransaction = new CreditTransaction()
                {
                    AdminNotes    = string.Empty,
                    Amount        = amount,
                    FromUserId    = fromid,
                    LinkedId      = linkedId,
                    Notes         = string.Empty,
                    Timestamp     = DateTime.Now,
                    ToUserId      = to,
                    PaymentTypeId = matchingPaymentType.Id
                };
                _creditTransactionRepository.Add(creditTransaction);
                return(Convert.ToBoolean(_creditTransactionRepository.Save()));
            }
            return(false);
        }
        public void Delete(int id)
        {
            var paymentType = _paymentsTypeService.GetPaymentType(id);

            _paymentsTypeService.Delete(paymentType);
        }