Esempio n. 1
0
        public List <TblUserWithdrawalRequest> Get(TransactionQueryBO transactionQuery, dbGSCasinoContext db)
        {
            // ENUMERATE ALL WALELT TYPES
            var _q = from a in db.TblUserWithdrawalRequest
                     //where a.WithdrawalStatus == (short)transactionQuery.RequestStatus
                     //&& a.CreatedOn >= transactionQuery.DateFrom && a.CreatedOn <= transactionQuery.DateTo

                     from UA in db.TblUserAuth where a.UserAuthId == UA.Id
                     join userInfo in db.TblUserInfo on UA.UserInfoId equals userInfo.Id

                     select new TblUserWithdrawalRequest
            {
                Id                 = a.Id,
                Address            = a.Address,
                TotalAmount        = a.TotalAmount,
                CreatedOn          = a.CreatedOn,
                UserAuthId         = a.UserAuthId,
                WithdrawalStatus   = a.WithdrawalStatus,
                SourceWalletTypeId = a.SourceWalletTypeId,
                TargetCurrencyId   = a.TargetCurrencyId,
                Remarks            = a.Remarks,
                CreatedBy          = a.CreatedBy,
                UserAuth           = new TblUserAuth {
                    Id = a.UserAuth.Id, UserInfo = UA.UserInfo, UserAlias = UA.UserAlias, UserName = UA.UserName
                }
            };

            List <TblUserWithdrawalRequest> _qWalletTypeRes = _q.ToList <TblUserWithdrawalRequest>();

            return(_qWalletTypeRes);
        }
Esempio n. 2
0
        public ActionResult UpdateWithdrawalRequest(TransactionQueryBO transactionQuery)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                UserResponseBO        _apiResponse          = new UserResponseBO();
                TransactionAppService transactionAppService = new TransactionAppService();
                transactionAppService.UpdateWithdrawalRequest(transactionQuery);

                _apiResponse.HttpStatusCode = "200";
                _apiResponse.Message        = "Transaction successful";
                _apiResponse.Status         = "Success";

                return(Ok(_apiResponse));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Esempio n. 3
0
        public List <TblUserDepositRequest> Get(TransactionQueryBO transactionQuery, dbGSCasinoContext db)
        {
            // ENUMERATE ALL WALELT TYPES
            var _q = from UDR in db.TblUserDepositRequest

                     from UA in db.TblUserAuth where UDR.UserAuthId == UA.Id
                     join userInfo in db.TblUserInfo on UA.UserInfoId equals userInfo.Id

                     //where UDR.DepositStatus == (short)transactionQuery.RequestStatus
                     //&& a.CreatedOn >= transactionQuery.DateFrom && a.CreatedOn <= transactionQuery.DateTo

                     select new TblUserDepositRequest
            {
                Id                 = UDR.Id,
                Address            = UDR.Address,
                Amount             = UDR.Amount,
                CreatedOn          = UDR.CreatedOn,
                UserAuthId         = UDR.UserAuthId,
                DepositStatus      = UDR.DepositStatus,
                SourceCurrencyId   = UDR.SourceCurrencyId,
                TargetWalletTypeId = UDR.TargetWalletTypeId,
                Remarks            = UDR.Remarks,
                CreatedBy          = UDR.CreatedBy,
                UserAuth           = new TblUserAuth {
                    Id = UDR.UserAuth.Id, UserInfo = UA.UserInfo, UserAlias = UA.UserAlias, UserName = UA.UserName
                }
            };


            List <TblUserDepositRequest> _qWalletTypeRes = _q.ToList <TblUserDepositRequest>();

            return(_qWalletTypeRes);
        }
Esempio n. 4
0
        public bool UpdateWithdrawalRequest(TransactionQueryBO transactionQueryBO)
        {
            using (var db = new dbGSCasinoContext())
            {
                UserWithdrawRequestRepository userWithdrawRequestRepository = new UserWithdrawRequestRepository();

                TblUserWithdrawalRequest userWithdrawalRequest = new TblUserWithdrawalRequest();
                userWithdrawalRequest.Id = transactionQueryBO.ID;
                userWithdrawalRequest.WithdrawalStatus = (short)transactionQueryBO.RequestStatus;


                userWithdrawRequestRepository.Update(userWithdrawalRequest, db);
            }

            return(true);
        }
Esempio n. 5
0
        public ActionResult History([FromBody] TransactionQueryBO transactionQuery)
        {
            try
            {
                // GET SESSIONS
                SessionController sessionController = new SessionController();
                TblUserAuth       userAuth          = sessionController.GetSession(HttpContext.Session);

                TransactionAppService           transactionAppService    = new TransactionAppService();
                List <UserTransactionHistoryBO> userTransactionHistories = transactionAppService.Get(transactionQuery);

                return(Ok(userTransactionHistories));
            }
            catch (Exception ex)
            {
                ApiResponseBO _apiResponse = new ApiResponseBO();
                _apiResponse.HttpStatusCode = "400";
                _apiResponse.Message        = ex.Message;
                _apiResponse.Status         = "Error";

                return(BadRequest(_apiResponse));
            }
        }
Esempio n. 6
0
        public List <UserTransactionHistoryBO> Get(TransactionQueryBO transactionQuery)
        {
            using (var db = new dbGSCasinoContext())
            {
                List <UserTransactionHistoryBO> userWithdrawalHistoryBOs  = new List <UserTransactionHistoryBO>();
                UserDepositRequestRepository    userDepositRequest        = new UserDepositRequestRepository();
                UserWithdrawRequestRepository   withdrawRequestRepository = new UserWithdrawRequestRepository();

                List <TblUserDepositRequest>    tblUserDeposits        = new List <TblUserDepositRequest>();
                List <TblUserWithdrawalRequest> userWithdrawalRequests = new List <TblUserWithdrawalRequest>();

                switch (transactionQuery.TransactionType)
                {
                case TransactionType.All:

                    tblUserDeposits = userDepositRequest.Get(transactionQuery, db);

                    for (int i = 0; i < tblUserDeposits.Count; i++)
                    {
                        UserTransactionHistoryBO withdrawalHistory = new UserTransactionHistoryBO();
                        withdrawalHistory.Address          = tblUserDeposits[i].Address;
                        withdrawalHistory.ID               = tblUserDeposits[i].Id;
                        withdrawalHistory.RequestedOn      = tblUserDeposits[i].CreatedOn;
                        withdrawalHistory.TotalAmount      = tblUserDeposits[i].Amount;
                        withdrawalHistory.WithdrawalStatus = (WithdrawalRequestStatus)tblUserDeposits[i].DepositStatus;
                        withdrawalHistory.MemberCode       = tblUserDeposits[i].UserAuth.UserInfo.Uid;
                        withdrawalHistory.MemberEmail      = tblUserDeposits[i].UserAuth.UserInfo.Email;
                        withdrawalHistory.MemberName       = String.Format("{0} {1}", tblUserDeposits[i].UserAuth.UserInfo.FirstName, tblUserDeposits[i].UserAuth.UserInfo.LastName);
                        withdrawalHistory.Txid             = tblUserDeposits[i].GetHashCode().ToString();

                        userWithdrawalHistoryBOs.Add(withdrawalHistory);
                    }

                    userWithdrawalRequests = withdrawRequestRepository.Get(transactionQuery, db);

                    for (int i = 0; i < userWithdrawalRequests.Count; i++)
                    {
                        UserTransactionHistoryBO withdrawalHistory = new UserTransactionHistoryBO();
                        withdrawalHistory.Address          = userWithdrawalRequests[i].Address;
                        withdrawalHistory.ID               = userWithdrawalRequests[i].Id;
                        withdrawalHistory.RequestedOn      = userWithdrawalRequests[i].CreatedOn;
                        withdrawalHistory.TotalAmount      = userWithdrawalRequests[i].TotalAmount;
                        withdrawalHistory.WithdrawalStatus = (WithdrawalRequestStatus)userWithdrawalRequests[i].WithdrawalStatus;
                        withdrawalHistory.MemberCode       = userWithdrawalRequests[i].UserAuth.UserInfo.Uid;
                        withdrawalHistory.MemberEmail      = userWithdrawalRequests[i].UserAuth.UserInfo.Email;
                        withdrawalHistory.MemberName       = String.Format("{0} {1}", userWithdrawalRequests[i].UserAuth.UserInfo.FirstName, userWithdrawalRequests[i].UserAuth.UserInfo.LastName);
                        withdrawalHistory.Txid             = userWithdrawalRequests[i].GetHashCode().ToString();

                        userWithdrawalHistoryBOs.Add(withdrawalHistory);
                    }

                    break;

                case TransactionType.Sent:
                    break;

                case TransactionType.Received:
                    break;

                case TransactionType.Deposit:

                    tblUserDeposits = userDepositRequest.Get(transactionQuery, db);

                    for (int i = 0; i < tblUserDeposits.Count; i++)
                    {
                        UserTransactionHistoryBO withdrawalHistory = new UserTransactionHistoryBO();
                        withdrawalHistory.Address          = tblUserDeposits[i].Address;
                        withdrawalHistory.ID               = tblUserDeposits[i].Id;
                        withdrawalHistory.RequestedOn      = tblUserDeposits[i].CreatedOn;
                        withdrawalHistory.TotalAmount      = tblUserDeposits[i].Amount;
                        withdrawalHistory.WithdrawalStatus = (WithdrawalRequestStatus)tblUserDeposits[i].DepositStatus;
                        withdrawalHistory.MemberCode       = tblUserDeposits[i].UserAuth.UserInfo.Uid;
                        withdrawalHistory.MemberEmail      = tblUserDeposits[i].UserAuth.UserInfo.Email;
                        withdrawalHistory.MemberName       = String.Format("{0} {1}", tblUserDeposits[i].UserAuth.UserInfo.FirstName, tblUserDeposits[i].UserAuth.UserInfo.LastName);
                        withdrawalHistory.Txid             = tblUserDeposits[i].GetHashCode().ToString();

                        userWithdrawalHistoryBOs.Add(withdrawalHistory);
                    }

                    break;

                case TransactionType.Withdraw:

                    userWithdrawalRequests = withdrawRequestRepository.Get(transactionQuery, db);

                    for (int i = 0; i < userWithdrawalRequests.Count; i++)
                    {
                        UserTransactionHistoryBO withdrawalHistory = new UserTransactionHistoryBO();
                        withdrawalHistory.Address          = userWithdrawalRequests[i].Address;
                        withdrawalHistory.ID               = userWithdrawalRequests[i].Id;
                        withdrawalHistory.RequestedOn      = userWithdrawalRequests[i].CreatedOn;
                        withdrawalHistory.TotalAmount      = userWithdrawalRequests[i].TotalAmount;
                        withdrawalHistory.WithdrawalStatus = (WithdrawalRequestStatus)userWithdrawalRequests[i].WithdrawalStatus;
                        withdrawalHistory.MemberCode       = userWithdrawalRequests[i].UserAuth.UserInfo.Uid;
                        withdrawalHistory.MemberEmail      = userWithdrawalRequests[i].UserAuth.UserInfo.Email;
                        withdrawalHistory.MemberName       = String.Format("{0} {1}", userWithdrawalRequests[i].UserAuth.UserInfo.FirstName, userWithdrawalRequests[i].UserAuth.UserInfo.LastName);
                        withdrawalHistory.Txid             = userWithdrawalRequests[i].GetHashCode().ToString();

                        userWithdrawalHistoryBOs.Add(withdrawalHistory);
                    }

                    break;

                default:
                    break;
                }

                return(userWithdrawalHistoryBOs);
            }
        }