protected void btnPurchaseKey_Click(object sender, EventArgs e) { try { divStakePurchase.Visible = true; UserAccountBLL accountBll = new UserAccountBLL(); DataTable dt = accountBll.getAccountSummaryById((string)LumexSessionManager.Get("ActiveUserId")); lblIncome.Text = dt.Rows[0]["Income"].ToString(); lblFxFund.Text = dt.Rows[0]["FxFund"].ToString(); } catch (Exception) { //throw; } }
private void getmyAccountSummary(string UserId) { try { UserAccountBLL userAccount = new UserAccountBLL(); DataTable dt = userAccount.getAccountSummaryById(UserId); if (dt.Rows.Count > 0) { lvlIncome.Text = dt.Rows[0]["Income"].ToString(); lvlDeposit.Text = dt.Rows[0]["Deposit"].ToString(); lvlCommision.Text = dt.Rows[0]["Commission"].ToString(); lvlFund.Text = dt.Rows[0]["FxFund"].ToString(); if (Convert.ToDecimal(dt.Rows[0]["Deposit"].ToString()) > 0) { btnDeposit.Visible = true; } if (Convert.ToDecimal(dt.Rows[0]["Commission"].ToString()) > 0) { btnCommissionTransfer.Visible = true; } //if (Convert.ToDecimal(dt.Rows[0]["FxFund"].ToString()) > 0) //{ // btnFxFundTransfer.Visible = true; //} } else { lvlIncome.Text = "0"; lvlDeposit.Text = "0"; lvlCommision.Text = "0"; lvlFund.Text = "0"; } } catch (Exception) { // throw; } }
protected void btnPurches_Click(object sender, EventArgs e) { try { UserAccountBLL userAccount = new UserAccountBLL(); StakeInfoBLL stakeInfo = new StakeInfoBLL(); UserBLL user = new UserBLL(); if (user.varifypin((string)LumexSessionManager.Get("ActiveUserId"), txtbxUserPintoPurches.Text)) { DataTable dt = userAccount.getAccountSummaryById((string) LumexSessionManager.Get("ActiveUserId")); Decimal WalletAmount = 0; string totalcount = ""; if (ddlPaymentBy.SelectedValue == "1") { WalletAmount = Convert.ToDecimal(dt.Rows[0]["Income"].ToString()); } else if (ddlPaymentBy.SelectedValue == "2") { WalletAmount = Convert.ToDecimal(dt.Rows[0]["FxFund"].ToString()); } if (Convert.ToDecimal(lblTotalPrice.Text) <= WalletAmount) { ///NEW/// StakeInfoBLL stake = new StakeInfoBLL(); int TotalPin = Convert.ToInt16(txtbxNoStake.Text); DataTable dtstake = new DataTable(); DataRow dr = null; dtstake.Columns.Add(new DataColumn("StakeId")); dtstake.Columns.Add(new DataColumn("StakePin")); dtstake.Columns.Add(new DataColumn("IsActive")); for (int i = 0; i < TotalPin;) { string pinserial = GetSerialNumber(); dr = dtstake.NewRow(); if (!stake.CheckDuplicateKey(pinserial)) { dr["StakeId"] = ddlstakeList.SelectedValue; dr["StakePin"] = pinserial; dr["IsActive"] = "Yes"; dtstake.Rows.Add(dr); i++; } } if (dtstake.Rows.Count == TotalPin && TotalPin > 0) { bool status = stake.SaveGeneratedPin(dtstake); if (status) { dt = stakeInfo.updateKeyWhenPurchase(lblQuntity.Text, lblUnitPrice.Text, ddlstakeList.SelectedValue, ddlPaymentBy.SelectedValue); if (dt.Rows.Count > 0) { totalcount = dt.Rows[0][0].ToString(); } string message = " <span class='actionTopic'>" + totalcount + "KEY purchase Successfully. Thanks" + "</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/a/stake/stakekeymanage.aspx\"; }; SuccessAlert(\"" + "Process Success" + "\", \"" + message + "\",callbackOk);"); getStakeKeyList(); } } } else { string message = " <span class='actionTopic'>" + "Sorry you don't have sufficent Amount to purchase KEY. Thanks" + "</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/a/initialdata/stakekeymanage.aspx\"; }; WarningAlert(\"" + "Process Failed" + "\", \"" + message + "\", \"\");"); } } else { string message = " <span class='actionTopic'>" +"Sorry Your PIN is not Correct. Input the correct one Thanks" + "</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/a/initialdata/stakekeymanage.aspx\"; }; WarningAlert(\"" + "Process Failed" + "\", \"" + message + "\", \"\");"); } } catch (Exception) { //throw; } }
private void getmyAccountSummary(string UserId) { try { UserAccountBLL userAccount = new UserAccountBLL(); DataTable dt = userAccount.getAccountSummaryById(UserId); if (dt.Rows.Count > 0) { lvlIncomeWallet.Text = (('$') + dt.Rows[0]["Income"].ToString()); lvlDepositWallet.Text = (('$') +dt.Rows[0]["Deposit"].ToString()); lvlCommisionWallet.Text = (('$') + dt.Rows[0]["Commission"].ToString()); lvlFxFund.Text = (('$') + dt.Rows[0]["FxFund"].ToString()); } else { lvlIncomeWallet.Text = "0"; lvlDepositWallet.Text = "0"; lvlCommisionWallet.Text = "0"; lvlFxFund.Text = "0"; } } catch (Exception) { // throw; } }