/// <summary>
        /// This method delete a transaction
        /// </summary>
        /// <param name="transactionID">transactionID</param>
        /// <returns></returns>
        public bool DeleteTransaction(int transactionID)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var adminTransactionRepo =
                        new AdminTransactionRepository(new EFRepository <AdminTransaction>(), unitOfWork);

                    ObjectSet <AdminTransaction> transactionObjSet =
                        ((CurrentDeskClientsEntities)adminTransactionRepo.Repository.UnitOfWork.Context).AdminTransactions;

                    //Get particular transaction
                    var transaction = transactionObjSet.Where(tran => tran.PK_TransactionID == transactionID).FirstOrDefault();

                    //Set IsDeleted true and save
                    if (transaction != null)
                    {
                        transaction.IsDeleted = true;
                        adminTransactionRepo.Save();
                        return(true);
                    }

                    return(false);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }
        // Add your own data access methods here.  If you wish to
        // expose your public method to a WCF service, marked them with
        // the attribute [NCPublish], and another T4 template will generate your service contract

        /// <summary>
        /// This method adds new fund account request in AdminTransaction table
        /// </summary>
        /// <param name="newRequest">newRequest</param>
        /// <returns></returns>
        public bool AddNewAdminTransactionRequest(AdminTransaction newRequest)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var adminTransactionRepo =
                        new AdminTransactionRepository(new EFRepository <AdminTransaction>(), unitOfWork);

                    adminTransactionRepo.Add(newRequest);
                    adminTransactionRepo.Save();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                return(false);
            }
        }
        /// <summary>
        /// This method approves a particular outgoing transaction
        /// </summary>
        /// <param name="approveTransaction">approveTransaction</param>
        /// <returns></returns>
        public bool ApproveOutgoingTransaction(AdminTransaction approveTransaction)
        {
            try
            {
                using (var unitOfWork = new EFUnitOfWork())
                {
                    var adminTransactionRepo =
                        new AdminTransactionRepository(new EFRepository <AdminTransaction>(), unitOfWork);

                    ObjectSet <AdminTransaction> transactionObjSet =
                        ((CurrentDeskClientsEntities)adminTransactionRepo.Repository.UnitOfWork.Context).AdminTransactions;

                    //Get particular transaction
                    var transaction = transactionObjSet.Where(tran => tran.PK_TransactionID == approveTransaction.PK_TransactionID).FirstOrDefault();

                    //Update its fields
                    if (transaction != null)
                    {
                        transaction.TransactionAmount  = approveTransaction.TransactionAmount;
                        transaction.FeeAmount          = approveTransaction.FeeAmount;
                        transaction.ApprovedDate       = DateTime.UtcNow;
                        transaction.Notes              = approveTransaction.Notes;
                        transaction.FK_FundingSourceID = approveTransaction.FK_FundingSourceID;
                        transaction.IsApproved         = true;

                        adminTransactionRepo.Save();
                        return(true);
                    }

                    return(false);
                }
            }
            catch (Exception ex)
            {
                CommonErrorLogger.CommonErrorLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
                throw;
            }
        }