/// <summary> /// Handles the Click event of the btnSubmit control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks></remarks> protected void btnSubmit_Click(object sender, EventArgs e) { try { string EMI = Request.Form[txtEMI.UniqueID].ToString(); if (string.IsNullOrWhiteSpace(EMI) || string.IsNullOrEmpty(EMI) || Convert.ToDouble(EMI) <= 0) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.SelectTxn + "');", true); BindGridUnbilledTransactions(accountNumber); return; } ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "Getamount();", false); CHRequestDetailManager crdm = new CHRequestDetailManager(); long RequestDtlID = crdm.SaveRequestDetail(new CH_Request_DtlDTO() { Request_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, RequestType_Id = Convert.ToInt64(hideRequestTypeId.Value), IP_Address = Request.UserHostAddress, EMI_Principal_Amt = Convert.ToDecimal(hdnIntTot.Value), EMI_Terms = Convert.ToInt32(ddlterms.SelectedItem.Text), EMI_Amount = Convert.ToDecimal(hdnEMI.Value), EMI_InterestRate = Convert.ToDecimal(txtInterest.Text), Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); //System.Collections.ArrayList[] = int row_Count = lstViewCardStatement.Items.Count; for (int i = 0; i < row_Count; i++) { CheckBox chkRow = (CheckBox)lstViewCardStatement.Items[i].FindControl("chkTransactions"); HiddenField HdnEMIId = (HiddenField)lstViewCardStatement.Items[i].FindControl("hdnEMIOracleId"); if (chkRow.Checked) { crdm.SaveEMIRequestDtl(new CH_EMI_Request_DTO() { Creditcard_acc_number = accountNumber.Encrypt(), Oracle_EMI_Id = HdnEMIId.Value, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, EMI_Loan_Type = "E", IP_Address = Request.UserHostAddress, }); } } Mailfunction(RequestDtlID); BindGridUnbilledTransactions(accountNumber); ShowEMIDiv(); } catch (Exception ex) { LblErrorMessage.Text = Constants.GeneralErrorMessage; DivERROR.Attributes.CssStyle.Add("display", "block"); } }
/// <summary> /// Handles the Click event of the btnSubmit control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks></remarks> protected void btnSubmit_Click(object sender, EventArgs e) { try { string EMI = Request.Form[txtEMI.UniqueID].ToString(); if (string.IsNullOrWhiteSpace(EMI) || string.IsNullOrEmpty(EMI) || Convert.ToDouble(EMI) <= 0) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.SelectTxn + "');", true); BindGridLoanTransactions(accountNumber); return; } ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "Getamount();", false); CHRequestDetailManager crdm = new CHRequestDetailManager(); string strInterest = HttpContext.Current.Request.Form[txtInterest.UniqueID]; string strEMIMonths = HttpContext.Current.Request.Form[txttermInMonth.UniqueID]; if (string.IsNullOrEmpty(strInterest)) { strInterest = txtInterest.Text; } if (string.IsNullOrEmpty(strInterest)) { strEMIMonths = txttermInMonth.Text; } long RequestDtlID = crdm.SaveRequestDetail(new CH_Request_DtlDTO() { Request_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, RequestType_Id = Convert.ToInt64(hideRequestTypeId.Value), IP_Address = Request.UserHostAddress, Loan_Principal_Amt = Convert.ToDecimal(hdnIntTot.Value), Loan_Terms = Convert.ToInt32(strEMIMonths), Loan_Amount = Convert.ToDecimal(hdnEMI.Value), Loan_InterestRate = Convert.ToDecimal(strInterest), Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); //System.Collections.ArrayList[] = int row_Count = gvLoantxn.Rows.Count; for (int i = 0; i < row_Count; i++) { CheckBox chkRow = (CheckBox)gvLoantxn.Rows[i].FindControl("chkTransactions"); HiddenField HdnLoanId = (HiddenField)gvLoantxn.Rows[i].FindControl("hdnLoanOracleId"); if (chkRow.Checked) { crdm.SaveEMIRequestDtl(new CH_EMI_Request_DTO() { Creditcard_acc_number = accountNumber.Encrypt(), Oracle_EMI_Id = HdnLoanId.Value, EMI_Loan_Type = "L", Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, IP_Address = Request.UserHostAddress, }); } } Mailfunction(RequestDtlID); chkAgree.Checked = false; BindGridLoanTransactions(accountNumber); } catch (Exception) { lblMessage.Text = Constants.GeneralErrorMessage; } }