private void InitialisePaymentLimits()
    {
        string strProcessCode  = string.Empty;
        string strProcessText  = string.Empty;
        string strMinLimit     = string.Empty;
        string strMaxLimit     = string.Empty;
        string strTotalAllowed = string.Empty;
        string strDailyLimit   = string.Empty;
        string strMethodId     = string.Empty;

        System.Data.DataTable dtPaymentMethodLimits = null;
        System.Data.DataRow   drPaymentMethodLimit  = null;

        System.Text.StringBuilder sbMethodsUnavailable = new System.Text.StringBuilder();

        strMethodId = "0";

        using (svcPayMember.MemberClient svcInstance = new svcPayMember.MemberClient())
        {
            dtPaymentMethodLimits = svcInstance.getMethodLimits(strOperatorId, strMemberCode, strMethodId, Convert.ToString(Convert.ToInt32(commonVariables.PaymentTransactionType.Withdrawal)), false, out strProcessCode, out strProcessText);
        }

        foreach (commonVariables.WithdrawalMethod EnumMethod in Enum.GetValues(typeof(commonVariables.WithdrawalMethod)))
        {
            if (dtPaymentMethodLimits.Select("[methodId] = " + Convert.ToInt32(EnumMethod)).Count() < 1)
            {
                sbMethodsUnavailable.AppendFormat("{0}|", Convert.ToInt32(EnumMethod));
            }
        }

        strMethodId = Convert.ToString(Convert.ToInt32(commonVariables.WithdrawalMethod.BankTransfer));

        if (dtPaymentMethodLimits.Select("[methodId] = " + strMethodId).Count() > 0)
        {
            drPaymentMethodLimit = dtPaymentMethodLimits.Select("[methodId] = " + strMethodId)[0];

            strMinLimit     = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["minDeposit"]).ToString(commonVariables.DecimalFormat);
            strMaxLimit     = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["maxDeposit"]).ToString(commonVariables.DecimalFormat);
            strTotalAllowed = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["totalAllowed"]).ToString(commonVariables.DecimalFormat);
            strDailyLimit   = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["limitDaily"]).ToString(commonVariables.DecimalFormat);

            //txtAmount.Attributes.Add("PLACEHOLDER", string.Format("{0} {1}({2} / {3})", lblAmount.Text, strCurrencyCode, strMinLimit, strMaxLimit));
            lblDailyLimit.InnerText   = string.Format("{0} {1}", commonCulture.ElementValues.getResourceString("lblDailyLimit", xeResources), strDailyLimit);
            lblTotalAllowed.InnerText = string.Format("{0} {1}", commonCulture.ElementValues.getResourceString("lblTotalAllowed", xeResources), strTotalAllowed);
        }
        //else { }

        strMethodsUnAvailable = Convert.ToString(sbMethodsUnavailable).TrimEnd('|');
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        #region initialiseVariables
        int    intProcessSerialId = 0;
        string strProcessId       = Guid.NewGuid().ToString().ToUpper();
        string strPageName        = "Deposit.FastDeposit";

        string strResultCode    = string.Empty;
        string strResultDetail  = string.Empty;
        string strErrorCode     = string.Empty;
        string strErrorDetail   = string.Empty;
        string strProcessRemark = string.Empty;
        bool   isProcessAbort   = false;
        bool   isSystemError    = false;

        long   lngOperatorId    = long.MinValue;
        string strDepositAmount = string.Empty;
        string strReferenceId   = string.Empty;
        string strSystemAccount = string.Empty;
        string strDepositDate   = string.Empty;
        //string strDepositDay = string.Empty;
        //string strDepositMonth = string.Empty;
        //string strDepositYear = string.Empty;
        string strDepositHour    = string.Empty;
        string strDepositMinute  = string.Empty;
        string strDepositChannel = string.Empty;
        string strBankCode       = string.Empty;
        string strBankName       = string.Empty;
        string strBankNameInput  = string.Empty;
        string strAccountName    = string.Empty;
        string strAccountNumber  = string.Empty;

        decimal decMinLimit     = decimal.Zero;
        decimal decMaxLimit     = decimal.Zero;
        decimal decTotalAllowed = decimal.Zero;
        decimal decDailyLimit   = decimal.Zero;

        System.DateTime          dtDepositDateTime = System.DateTime.MinValue;
        System.Xml.Linq.XElement xeResponse        = null;

        bool   isDepositSuccessful = false;
        string strTransferId       = string.Empty;
        bool   sessionExpired      = false;

        #endregion

        #region populateVariables
        lngOperatorId   = long.Parse(commonVariables.OperatorId);
        strMemberCode   = commonVariables.GetSessionVariable("MemberCode");
        strCurrencyCode = commonVariables.GetSessionVariable("CurrencyCode");

        strDepositAmount = txtAmount.Value;
        strReferenceId   = txtReferenceId.Value;
        strSystemAccount = drpSystemAccount.Value;
        strDepositDate   = drpDepositDate.Value;
        //strDepositDay = drpDay.SelectedValue;
        //strDepositMonth = drpMonth.SelectedValue;
        //strDepositYear = drpYear.SelectedValue;
        strDepositHour    = drpHour.Value;
        strDepositMinute  = drpMinute.Value;
        strDepositChannel = drpDepositChannel.Value;
        strBankCode       = drpBank.Value;
        strBankName       = drpBank.Items.FindByValue(strBankCode).Text;
        strBankNameInput  = txtBankName.Value;
        strAccountName    = txtAccountName.Value;
        strAccountNumber  = txtAccountNumber.Value;

        if (string.Compare(strCurrencyCode, "krw", true) == 0)
        {
            dtDepositDateTime = System.DateTime.Now;
        }
        //else { dtDepositDateTime = System.DateTime.Parse(drpDepositDate.SelectedValue)}//new System.DateTime(Convert.ToInt32(strDepositYear), Convert.ToInt32(strDepositMonth), Convert.ToInt32(strDepositDay), Convert.ToInt32(strDepositHour), Convert.ToInt32(strDepositMinute), 0); }
        #endregion

        #region parametersValidation
        if (string.IsNullOrEmpty(strDepositAmount))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/MissingDepositAmount", xeErrors); return;
        }
        else if (string.IsNullOrEmpty(strAccountName))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/MissingAccountName", xeErrors); return;
        }
        else if (string.IsNullOrEmpty(strAccountNumber))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/MissingAccountNumber", xeErrors); return;
        }
        else if (string.Compare(drpBank.Value, "OTHER", true) == 0 && string.IsNullOrEmpty(strBankNameInput))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/MissingBankName", xeErrors); return;
        }
        else if (Convert.ToString(drpSystemAccount.Value) == "-1")
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/SelectSystemAccount", xeErrors); return;
        }
        else if (Convert.ToString(drpDepositChannel.Value) == "-1")
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/SelectDepositChannel", xeErrors); return;
        }
        else if (Convert.ToString(drpBank.Value) == "-1")
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/SelectBank", xeErrors); return;
        }
        else if (!commonValidation.isDecimal(strDepositAmount))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidDepositAmount", xeErrors); return;
        }
        else if (Convert.ToDecimal(strDepositAmount) <= 0)
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidDepositAmount", xeErrors); return;
        }
        else if (commonValidation.isInjection(strDepositAmount))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidDepositAmount", xeErrors); return;
        }
        else if (commonValidation.isInjection(strReferenceId))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidReferenceId", xeErrors); return;
        }
        else if (commonValidation.isInjection(strBankNameInput))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidBankName", xeErrors); return;
        }
        else if (commonValidation.isInjection(strAccountName))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidAccountName", xeErrors); return;
        }
        else if (commonValidation.isInjection(strAccountNumber))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidAccountNumber", xeErrors); return;
        }
        else if (string.Compare(strCurrencyCode, "krw", true) != 0)
        {
            if (!string.IsNullOrEmpty(strDepositDate))
            {
                dtDepositDateTime = System.DateTime.Parse(strDepositDate);
                if ((dtDepositDateTime - System.DateTime.Now).TotalHours > 72 || (dtDepositDateTime - System.DateTime.Now).TotalHours < -72)
                {
                    strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidDateTime", xeErrors); return;
                }
            }
            else if (string.IsNullOrEmpty(strDepositDate))
            {
                strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/InvalidDateTime", xeErrors); return;
            }
        }
        else if (string.IsNullOrEmpty(strMemberCode))
        {
            strAlertCode    = "-1";
            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/SessionExpired", xeErrors);
            isProcessAbort  = true;
            sessionExpired  = true;
        }
        else if (string.IsNullOrEmpty(strCurrencyCode))
        {
            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/FundTransfer/SessionExpired", xeErrors);
            isProcessAbort  = true;
            sessionExpired  = true;
        }

        #endregion

        #region initialiseDeposit
        if (!isProcessAbort)
        {
            try
            {
                string strProcessCode = string.Empty;
                string strProcessText = string.Empty;

                System.Data.DataTable dtPaymentMethodLimits = null;

                using (svcPayMember.MemberClient svcInstance = new svcPayMember.MemberClient())
                {
                    dtPaymentMethodLimits = svcInstance.getMethodLimits(strOperatorId, strMemberCode, Convert.ToString(Convert.ToInt32(commonVariables.DepositMethod.FastDeposit)), Convert.ToString(Convert.ToInt32(commonVariables.PaymentTransactionType.Deposit)), false, out strProcessCode, out strProcessText);

                    if (dtPaymentMethodLimits.Rows.Count > 0)
                    {
                        decMinLimit     = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["minDeposit"]);
                        decMaxLimit     = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["maxDeposit"]);
                        decTotalAllowed = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["totalAllowed"]);
                        decDailyLimit   = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["limitDaily"]);

                        if (Convert.ToDecimal(strDepositAmount) < decMinLimit)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/AmountMinLimit", xeErrors);
                            isProcessAbort  = true;
                        }
                        else if (Convert.ToDecimal(strDepositAmount) > decMaxLimit)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/AmountMaxLimit", xeErrors);
                            isProcessAbort  = true;
                        }
                        else if (Convert.ToDecimal(strDepositAmount) > decTotalAllowed)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/TotalAllowedExceeded", xeErrors);
                            isProcessAbort  = true;
                        }
                    }
                }

                if (!isProcessAbort)
                {
                    using (svcPayDeposit.DepositClient svcInstance = new svcPayDeposit.DepositClient())
                    {
                        xeResponse = svcInstance.createFastDepositTransactionV1(lngOperatorId, strMemberCode, strDepositChannel, Convert.ToInt64(commonVariables.DepositMethod.FastDeposit),
                                                                                strCurrencyCode, Convert.ToDecimal(strDepositAmount), Convert.ToInt64(strSystemAccount), strAccountName, strAccountNumber, dtDepositDateTime,
                                                                                strReferenceId, strBankCode, strBankName, strBankNameInput, Convert.ToString(commonVariables.TransactionSource.Wap));

                        if (xeResponse == null)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/TransferFail", xeErrors);
                        }
                        else
                        {
                            isDepositSuccessful = Convert.ToBoolean(commonCulture.ElementValues.getResourceString("result", xeResponse));
                            strTransferId       = commonCulture.ElementValues.getResourceString("invId", xeResponse);

                            if (isDepositSuccessful)
                            {
                                strAlertCode      = "0";
                                strAlertMessage   = string.Format("{0}\\n{1}: {2}", commonCulture.ElementValues.getResourceXPathString("/Deposit/TransferSuccess", xeErrors), commonCulture.ElementValues.getResourceString("lblTransactionId", xeResources), strTransferId);
                                btnSubmit.Visible = false;
                                btnBack.Value     = commonCulture.ElementValues.getResourceString("home", commonVariables.LeftMenuXML);
                            }
                            else
                            {
                                strAlertCode    = "-1";
                                strAlertMessage = string.Format("{0}\\n{1}", commonCulture.ElementValues.getResourceXPathString("/Deposit/TransferFail", xeErrors), commonCulture.ElementValues.getResourceXPathString("/Deposit/error" + strTransferId, xeErrors));
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                strAlertCode    = "-1";
                strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Deposit/Exception", xeErrors);

                strErrorDetail = ex.Message;
            }

            strProcessRemark = string.Format("OperatorId: {0} | MemberCode: {1} | CurrencyCode: {2} | DepositAmount: {3} | DepositChannel: {4} | AccountName: {6} | AccountNumber: {6} | SystemAccount: {7} | BankCode: {8} | BankName: {9} | BankNameInput: {10} | ReferenceID: {11} | DepositDateTime: {12} | MinLimit: {13} | MaxLimit: {14} | TotalAllowed: {15} | DailyLimit: {16} | Response: {17}",
                                             lngOperatorId, strMemberCode, strCurrencyCode, strDepositAmount, strDepositChannel, strAccountName, strAccountNumber, strSystemAccount, strBankCode, strBankName, strBankNameInput, strReferenceId, dtDepositDateTime.ToString("yyyy-MM-dd HH:mm:ss"), decMinLimit, decMaxLimit, decTotalAllowed, decDailyLimit, xeResponse == null ? string.Empty : xeResponse.ToString());

            intProcessSerialId += 1;
            commonAuditTrail.appendLog("system", strPageName, "InitiateDeposit", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError);
        }

        #region Response
        txtMessage.InnerHtml = strAlertMessage.Replace("\\n", "<br />");
        #endregion

        #endregion

        if (sessionExpired)
        {
            Response.Redirect("/Expire");
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        #region initialiseVariables
        int    intProcessSerialId = 0;
        string strProcessId       = Guid.NewGuid().ToString().ToUpper();
        string strPageName        = "Withdrawal.BankTransfer";

        string strResultCode    = string.Empty;
        string strResultDetail  = string.Empty;
        string strErrorCode     = string.Empty;
        string strErrorDetail   = string.Empty;
        string strProcessRemark = string.Empty;
        bool   isProcessAbort   = false;
        bool   isSystemError    = false;

        long   lngOperatorId     = long.MinValue;
        string strWithdrawAmount = string.Empty;
        string strBankCode       = string.Empty;
        string strBankName       = string.Empty;
        string strBankNameInput  = string.Empty;
        string strBankBranch     = string.Empty;
        string strBankAddress    = string.Empty;
        string strAccountName    = string.Empty;
        string strAccountNumber  = string.Empty;
        string strMyKad          = string.Empty;
        string strMobileNumber   = string.Empty;
        bool   MobileNotify      = false;

        decimal decMinLimit     = decimal.Zero;
        decimal decMaxLimit     = decimal.Zero;
        decimal decTotalAllowed = decimal.Zero;
        decimal decDailyLimit   = decimal.Zero;

        System.Xml.Linq.XElement xeResponse = null;

        bool   isWithdrawSuccessful = false;
        string strTransferId        = string.Empty;

        bool sessionExpired = false;
        #endregion

        #region populateVariables
        lngOperatorId   = long.Parse(commonVariables.OperatorId);
        strMemberCode   = commonVariables.GetSessionVariable("MemberCode");
        strCurrencyCode = commonVariables.GetSessionVariable("CurrencyCode");

        strWithdrawAmount = txtAmount.Value;
        strBankCode       = drpBank.Value;
        strBankName       = drpBank.Items.FindByValue(strBankCode).Text;
        strBankNameInput  = txtBankName.Value;
        strBankAddress    = txtAddress.Value;
        strBankBranch     = txtBankBranch.Value;
        strAccountName    = txtAccountName.Value;
        strAccountNumber  = txtAccountNumber.Value;
        strMyKad          = txtMyKad.Value;

        System.Text.RegularExpressions.Regex regxATM = new System.Text.RegularExpressions.Regex("([0-9]{16})$");

        #endregion

        #region parametersValidation
        if (string.IsNullOrEmpty(strWithdrawAmount))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingWithdrawalAmount", xeErrors); return;
        }
        else if (string.IsNullOrEmpty(strAccountName))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingAccountName", xeErrors); return;
        }
        else if (string.IsNullOrEmpty(strAccountNumber))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingAccountNumber", xeErrors); return;
        }
        else if (string.Compare(drpBank.Value, "OTHER", true) == 0 && string.IsNullOrEmpty(strBankNameInput))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingBankName", xeErrors); return;
        }
        //else if (string.Compare(drpBank.SelectedValue, "VIETIN", true) == 0 && (!commonValidation.isNumeric(strAccountNumber) || !regxATM.IsMatch(strAccountNumber))) { strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidAccountNumber", xeErrors); return; }
        else if (string.IsNullOrEmpty(strBankBranch) && string.Compare(strCurrencyCode, "krw", true) != 0)
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingBankBranch", xeErrors); return;
        }
        else if (string.IsNullOrEmpty(strBankAddress) && string.Compare(strCurrencyCode, "krw", true) != 0)
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingBankAddress", xeErrors); return;
        }
        else if (string.Compare(strCurrencyCode, "myr", true) == 0)
        {
            if (string.IsNullOrEmpty(strMyKad))
            {
                strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingAccountNumber", xeErrors); return;
            }
        }
        else if (Convert.ToString(drpBank.Value) == "-1")
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/SelectBank", xeErrors); return;
        }
        else if (!commonValidation.isDecimal(strWithdrawAmount))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidWithdrawAmount", xeErrors); return;
        }
        else if (Convert.ToDecimal(strWithdrawAmount) <= 0)
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidWithdrawAmount", xeErrors); return;
        }
        else if (commonValidation.isInjection(strWithdrawAmount))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidWithdrawAmount", xeErrors); return;
        }
        else if (commonValidation.isInjection(strBankNameInput))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidBankName", xeErrors); return;
        }
        else if (commonValidation.isInjection(strAccountName))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidAccountName", xeErrors); return;
        }
        else if (commonValidation.isInjection(strAccountNumber))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidAccountNumber", xeErrors); return;
        }
        else if (commonValidation.isInjection(strBankBranch))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidBankBranch", xeErrors); return;
        }
        else if (commonValidation.isInjection(strBankAddress))
        {
            strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/InvalidBankAddress", xeErrors); return;
        }
        else if (string.Compare(strCurrencyCode, "myr", true) == 0)
        {
            if (commonValidation.isInjection(strMyKad))
            {
                strAlertCode = "-1"; strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/MissingMyKad", xeErrors); return;
            }
        }
        else if (string.IsNullOrEmpty(strMemberCode))
        {
            strAlertCode    = "-1";
            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/SessionExpired", xeErrors);
            isProcessAbort  = true;
            sessionExpired  = true;
        }
        else if (string.IsNullOrEmpty(strCurrencyCode))
        {
            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/FundTransfer/SessionExpired", xeErrors);
            isProcessAbort  = true;
            sessionExpired  = true;
        }
        #endregion

        #region initialiseWithdrawal
        if (!isProcessAbort)
        {
            try
            {
                string strProcessCode = string.Empty;
                string strProcessText = string.Empty;

                System.Data.DataTable dtPaymentMethodLimits = null;

                using (svcPayMember.MemberClient svcInstance = new svcPayMember.MemberClient())
                {
                    dtPaymentMethodLimits = svcInstance.getMethodLimits(strOperatorId, strMemberCode, Convert.ToString(Convert.ToInt32(commonVariables.WithdrawalMethod.BankTransfer)), Convert.ToString(Convert.ToInt32(commonVariables.PaymentTransactionType.Withdrawal)), false, out strProcessCode, out strProcessText);

                    if (dtPaymentMethodLimits.Rows.Count > 0)
                    {
                        decMinLimit     = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["minWithdrawal"]);
                        decMaxLimit     = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["maxWithdrawal"]);
                        decTotalAllowed = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["totalAllowed"]);
                        decDailyLimit   = Convert.ToDecimal(dtPaymentMethodLimits.Rows[0]["limitDaily"]);

                        if (Convert.ToDecimal(strWithdrawAmount) < decMinLimit)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/AmountMinLimit", xeErrors);
                            isProcessAbort  = true;
                        }
                        else if (Convert.ToDecimal(strWithdrawAmount) > decMaxLimit)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/AmountMaxLimit", xeErrors);
                            isProcessAbort  = true;
                        }
                        else if (Convert.ToDecimal(strWithdrawAmount) > decTotalAllowed)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/TotalAllowedExceeded", xeErrors);
                            isProcessAbort  = true;
                        }
                    }
                }

                if (!isProcessAbort)
                {
                    using (svcPayWithdrawal.WithdrawalClient svcInstance = new svcPayWithdrawal.WithdrawalClient())
                    {
                        xeResponse = svcInstance.createBankTransferTransactionV1(lngOperatorId, strMemberCode, Convert.ToInt64(commonVariables.WithdrawalMethod.BankTransfer),
                                                                                 strCurrencyCode, Convert.ToDecimal(strWithdrawAmount), strAccountName, strAccountNumber, strBankAddress, strBankBranch, strBankCode, strBankName, strBankNameInput,
                                                                                 strMyKad, strMobileNumber, MobileNotify, Convert.ToString(commonVariables.TransactionSource.Wap));

                        if (xeResponse == null)
                        {
                            strAlertCode    = "-1";
                            strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/TransferFail", xeErrors);
                        }
                        else
                        {
                            isWithdrawSuccessful = Convert.ToBoolean(commonCulture.ElementValues.getResourceString("result", xeResponse));
                            strTransferId        = commonCulture.ElementValues.getResourceString("invId", xeResponse);

                            if (isWithdrawSuccessful)
                            {
                                strAlertCode      = "0";
                                strAlertMessage   = string.Format("{0}\\n{1}: {2}", commonCulture.ElementValues.getResourceXPathString("/Withdrawal/TransferSuccess", xeErrors), commonCulture.ElementValues.getResourceString("lblTransactionId", xeResources), strTransferId);
                                btnSubmit.Visible = false;
                                btnBack.Value     = commonCulture.ElementValues.getResourceString("home", commonVariables.LeftMenuXML);
                            }
                            else
                            {
                                strAlertCode    = "-1";
                                strAlertMessage = string.Format("{0}\\n{1}", commonCulture.ElementValues.getResourceXPathString("/Withdrawal/TransferFail", xeErrors), commonCulture.ElementValues.getResourceXPathString("/Withdrawal/error" + strTransferId, xeErrors));
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                strAlertCode    = "-1";
                strAlertMessage = commonCulture.ElementValues.getResourceXPathString("/Withdrawal/Exception", xeErrors);

                strErrorDetail = ex.Message;
            }

            strProcessRemark = string.Format("OperatorId: {0} | MemberCode: {1} | CurrencyCode: {2} | WithdrawAmount: {3} | AccountName: {4} | AccountNumber: {5} | BankAddress: {6} | BankBranch: {7} | BankCode: {8} | BankName: {9} | BankNameInput: {10} | MyKad: {11} | Mobile: {12} | MinLimit: {13} | MaxLimit: {14} | TotalAllowed: {15} | DailyLimit: {16} | Response: {17}",
                                             lngOperatorId, strMemberCode, strCurrencyCode, strWithdrawAmount, strAccountName, strAccountNumber, strBankAddress, strBankBranch, strBankCode, strBankName, strBankNameInput, strMyKad, strMobileNumber, decMinLimit, decMaxLimit, decTotalAllowed, decDailyLimit, xeResponse == null ? string.Empty : xeResponse.ToString());

            intProcessSerialId += 1;
            commonAuditTrail.appendLog("system", strPageName, "InitiateWithdrawal", "DataBaseManager.DLL", strResultCode, strResultDetail, strErrorCode, strErrorDetail, strProcessRemark, Convert.ToString(intProcessSerialId), strProcessId, isSystemError);
        }
        #region Response
        txtMessage.InnerHtml = strAlertMessage.Replace("\\n", "<br />");
        #endregion

        #endregion

        if (sessionExpired)
        {
            Response.Redirect("/Expire");
        }
    }