//protected void btnReset_Click(object sender, EventArgs e) //{ // try // { // btnSubmitfinal.Attributes.CssStyle.Add("display", "block"); // btnReset.Visible = false; // divStatusMessage.Attributes.CssStyle.Add("display", "none"); // divMain.Attributes.CssStyle.Add("display", "block"); // EnableDisableControl(); // } // catch (Exception ex) // { // } //} /// <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 btnDeregister_Click(object sender, EventArgs e) { try { if (ddlReasons.SelectedValue == "-1") { lblErrorReasons.Text = Constants.Selectreason; return; } 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), RequestReason_Id = Convert.ToInt64(ddlReasons.SelectedValue), IP_Address = Request.UserHostAddress, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(RequestDtlID); Clearcontrols(); LblSuccessMessage.Text = "Request of discontinue of Auto Debit Payment has been sent"; DivSuccess.Attributes.CssStyle.Add("display", "block"); } catch (Exception) { 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 { //if (ddlIssueBank.SelectedValue == "-1") //{ // lblMessage.Text = "Please select Bank name"; // return; //} 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, OtherCreditCardNumber = txtCRnum1.Text + txtCRnum2.Text + txtCRnum3.Text + txtCRnum4.Text, Bank_nm = ddlIssueBank.SelectedItem.Text, Transferred_Amt = Convert.ToDecimal(txtAmtTransfered.Text), Balance_Transferred_Plan = Convert.ToString(ddlPLan.SelectedValue), // ddlPLan.SelectedItem.Text, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(RequestDtlID); //lblMessage.Text = "Request for Transfer amount has been sent"; //lblMessage.CssClass = "msgsuccess"; ClearControls(); } catch (Exception) { lblMessage.Text = Constants.GeneralErrorMessage; } }
/// <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 { var crdm = new CHRequestDetailManager(); var requestDtlId = crdm.SaveRequestDetail(new CH_Request_DtlDTO() { Request_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, RequestType_Id = Convert.ToInt64(hideRequestTypeId.Value), Payment_Type = (rbTotalAmountDue.Checked == true ? hideTotalAmountDue.Value : (rbMinimumAmountDue.Checked == true ? hideMinimumAmountDue.Value : (rbPercentage.Checked == true ? hidePercentage.Value : ""))), Specific_Monthly_due = rbPercentage.Checked == true ? Convert.ToDecimal(txtPercentage.Text) : (decimal?)null, IP_Address = Request.UserHostAddress, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(requestDtlId); Clearcontrols(); } catch (Exception) { 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 { bool IsAllowToAdd = CheckPendingRequest(); if (!IsAllowToAdd) { Clearcontrols(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.PendingRequestState + "');", true); return; } string mode = ""; if (chkAgree.Checked == false) { lblMessage.Text = Constants.agreeTnC; return; } else if (chkMode.Items[0].Selected == false && chkMode.Items[1].Selected == false) { lblMessage.Text = Constants.selectmode; lblMessage.CssClass = "error"; return; } else if (chkMode.Items[0].Selected == true && chkMode.Items[1].Selected == true) { mode = "B"; } else if (chkMode.Items[0].Selected == true && chkMode.Items[1].Selected == false) { mode = "E"; } else if (chkMode.Items[0].Selected == false && chkMode.Items[1].Selected == true) { mode = "H"; } 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), Mode_Send_Statment = mode, IP_Address = Request.UserHostAddress, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(RequestDtlID); Clearcontrols(); //lblMessage.Text = "Statement Request has been sent"; //lblMessage.CssClass = "msgsuccess"; } catch (Exception) { lblMessage.Text = Constants.GeneralErrorMessage; lblMessage.CssClass = "error"; } }
private void UpdateStatus(dynamic result, long Request_Dtl_Id) { CHRequestDetailManager crdm = new CHRequestDetailManager(); string requestStatus = string.Empty; if (result != null) { if (result["RespCode"] == "000") { requestStatus = "Approved"; } else { requestStatus = "Rejected"; } } else { requestStatus = "Rejected"; } long RequestDtlID = crdm.SaveRequestDetail(new CH_Request_DtlDTO() { Request_Dtl_Id = Request_Dtl_Id, Request_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, RequestType_Id = Convert.ToInt64(hideRequestTypeId.Value), IP_Address = Request.UserHostAddress, Created_dt = DateTime.Now, Updated_dt = DateTime.Now, Updated_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = requestStatus }); }
/// <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 { bool IsAllowToAdd = CheckPendingRequest(); if (!IsAllowToAdd) { Clearcontrols(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.PendingRequestState + "');", true); return; } 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), RequestReason_Id = Convert.ToInt64(ddlReasons.SelectedValue), IP_Address = Request.UserHostAddress, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(RequestDtlID); Clearcontrols(); } catch (Exception) { lblMessage.Text = Constants.GeneralErrorMessage; lblMessage.CssClass = "error"; } }
/// <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 btnSave_Click(object sender, EventArgs e) { try { hideCreditCardNumber.Value = ddlcardlist.SelectedValue; hideInternationalLimit.Value = internationalUsage.Checked ? "Active" : "Deactive"; ddlcardlist.Enabled = false; internationalUsage.Enabled = false; txtAmount.Attributes.CssStyle.Add("disabled", "disabled"); //btnSave.Enabled = false; string strInternationalLimit = string.Empty; Session["Card_Num"] = ddlcardlist.SelectedValue.Encrypt(); string crAccNum = CardHolderManager.GetLoggedInUser().creditcard_acc_number.Decrypt(); Session["crAccNum"] = crAccNum; CHRequestDetailManager crdm = new CHRequestDetailManager(); string hotlistingCardNumber = hideCreditCardNumber.Value; Int32 principalAmount = 0; string Flag = "I"; string requestflag = string.Empty; LblActivateDeactivateMsg.Text = ""; if (internationalUsage.Checked == true) { requestflag = "Active"; principalAmount = Convert.ToInt32(txtAmount.Value); } else { LblAmoutErrorMessage.Attributes.CssStyle.Add("display", "none"); principalAmount = 0; requestflag = "Deactive"; } 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, HotlistingCardNumber = hotlistingCardNumber, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString(), Loan_Principal_Amt = principalAmount, RequestFlag = requestflag }); System.Threading.Thread.Sleep(1000); CreateRequest(RequestDtlID, principalAmount, Flag, hotlistingCardNumber, requestflag); btnSave.Style.Remove("data-loading"); } catch (Exception ex) { string str = ex.Message; 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 { bool IsAllowToAdd = CheckPendingRequest(); if (!IsAllowToAdd) { txtpointsReddeem.Text = string.Empty; chkAgree.Checked = false; lblMessage.Text = Constants.PendingRequestState; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } int redeempts = string.IsNullOrEmpty(txtpointsReddeem.Text) ? 0 : Convert.ToInt32(txtpointsReddeem.Text); int earnedpts = string.IsNullOrEmpty(lblEarnedPoints.Text) ? 0 : lblEarnedPoints.Text != "NIL" ? Convert.ToInt32(lblEarnedPoints.Text) :0; CHRequestDetailManager crdm = new CHRequestDetailManager(); if (txtpointsReddeem.Text.Trim() != "" && redeempts >= 500 && redeempts <= earnedpts) { 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, Points_Wants_Redeem = Convert.ToInt32(txtpointsReddeem.Text), Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(RequestDtlID); } else { lblMessage.Text = Constants.LessPoints; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } txtpointsReddeem.Text = string.Empty; chkAgree.Checked = false; } catch (Exception) { 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 { hideReason.Value = ddlReasons.SelectedItem.Text; hideCreditCardNumber.Value = ddlcardlist.SelectedValue; ddlcardlist.Enabled = false; ddlReasons.Enabled = false; Session["Card_Num"] = ddlcardlist.SelectedValue.Encrypt(); if (ddlReasons.SelectedValue == "-1") { lblErrorReasons.Text = Constants.Selectreason; return; } 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, RequestReason_Id = Convert.ToInt64(ddlReasons.SelectedValue), HotlistingCardNumber = ddlcardlist.SelectedValue.Encrypt(), Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); System.Threading.Thread.Sleep(1000); CreateRequest(RequestDtlID); btnSubmit.Style.Remove("data-loading"); ddlReasons.SelectedValue = "-1"; } catch (Exception ex) { string strErrpr = ex.Message; lblErrorReasons.Text = Constants.GeneralErrorMessage; } }
/// <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; } }
/// <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 { if (ddlAppropRequestComplaint.SelectedValue == "-1" || RadioRequestComplaint.SelectedValue == "-1") { lblMessage.Text = Constants.SelectReqComp; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } else if (RadioRequestComplaint.SelectedValue == "0") { bool IsAllowToAdd = CheckPendingRequest(); if (!IsAllowToAdd) { lblMessage.Text = Constants.PendingRequestState; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } CHRequestDetailManager crdm = new CHRequestDetailManager(); int pendingcount = crdm.CheckRequestPending(CardHolderManager.GetLoggedInUser().CardHolder_Id, Convert.ToInt64(ddlAppropRequestComplaint.SelectedValue), ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString()); if (pendingcount > 0) { lblMessage.Text = Constants.PendingRequestState; DivMessage.Attributes.CssStyle.Add("display", "block"); } else { long RequestDtlID = crdm.SaveRequestDetail(new CH_Request_DtlDTO() { Request_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, IP_Address = Request.UserHostAddress, RequestType_Id = Convert.ToInt64(ddlAppropRequestComplaint.SelectedValue), Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Remarks = Convert.ToString(txtremarks.Text), Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(RequestDtlID); } } else if (RadioRequestComplaint.SelectedValue == "1") { bool IsAllowToAdd = CheckPendingComplaint(); if (!IsAllowToAdd) { lblMessage.Text = Constants.PendingRequestState; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } CardHolderComplaintManager crdm = new CardHolderComplaintManager(); long ComplaintDtlID = crdm.SaveComplaintDetail(new CH_Complaint_DtlDTO() { Complaint_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, IP_Address = Request.UserHostAddress, ComplaintType_Id = Convert.ToInt64(ddlAppropRequestComplaint.SelectedValue), Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Created_dt = DateTime.Now, Remarks = Convert.ToString(txtremarks.Text), Complaint_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(ComplaintDtlID); } Clearcontrols(); } catch (Exception ex) { LblErrorMessage.Text = Constants.GeneralErrorMessage; DivERROR.Attributes.CssStyle.Add("display", "block"); } }
/// <summary> /// Handles the Click event of the btnSubmitfinal 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 btnSubmitfinal_Click(object sender, EventArgs e) { try { lblMessage.Text = ""; string filename = ""; string saveFile = ""; int TotalAddons = 0; string IsaccountEligible = ""; if (ddlRequestService.SelectedItem.Text == @"Request/Renewal") { bool IsAllowToAdd = CheckPendingRequestForReplacementRenewal(); if (!IsAllowToAdd) { Clearcontrols(); string requestService = ddlRequestType.SelectedItem.Text; lblMessage.Text = "Sorry! request for " + requestService + " is already in pending state, you cannot make this request"; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } else { lblMessage.Text = string.Empty; DivMessage.Attributes.CssStyle.Add("display", "none"); } } else { bool IsAllowToAdd = CheckPendingRequest(); if (!IsAllowToAdd) { Clearcontrols(); lblMessage.Text = Constants.PendingRequestState; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } else { lblMessage.Text = string.Empty; DivMessage.Attributes.CssStyle.Add("display", "none"); } } if (ddlRequestService.SelectedItem.Text == "Request for Add-On card") { //Step 1 Check for addons IsaccountEligible = IsAccountEligible(); if (IsaccountEligible == "") { lblMessage.Text = Constants.AccountNotEligible; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } TotalAddons = TotalAddonCards(); if (TotalAddons == 3) { lblMessage.Text = Constants.only3Addons; DivMessage.Attributes.CssStyle.Add("display", "block"); return; } ///Step 2 Upload File if (photoUpload.HasFile) { var bytes = new byte[20]; photoUpload.PostedFile.InputStream.Read(bytes, 0, 20); if (!GeneralMethods.CheckFileHeader(photoUpload.FileName, bytes, EXTENSIONS_ATTACH)) { GeneralMethods.AlertMessage(Page, "Please Upload file having file type is .jpg or .jpeg or .png only"); return; } if (!System.IO.Directory.Exists(string.Format("{0}{1}\\{2}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, ADDON_FOLDER))) { System.IO.Directory.CreateDirectory(string.Format("{0}{1}\\{2}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, ADDON_FOLDER)); } filename = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(photoUpload.FileName); saveFile = string.Format("{0}{1}\\{2}\\{3}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, ADDON_FOLDER, filename); photoUpload.SaveAs(saveFile); } } CHRequestDetailManager crdm = new CHRequestDetailManager(); long RequestDtlID = 0; if (ddlRequestService.SelectedItem.Text == @"Request/Renewal") { RequestDtlID = crdm.SaveRequestDetail(new CH_Request_DtlDTO() { Request_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, RequestType_Id = Convert.ToInt64(ddlRequestType.SelectedValue), IP_Address = Request.UserHostAddress, RequestReason_Id = Convert.ToInt64(ddlReasons.SelectedValue), Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); } else if (ddlRequestService.SelectedItem.Text == "De-Register Credit Card") { 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, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); } else if (ddlRequestService.SelectedItem.Text == "Request for Add-On card") { RequestDtlID = crdm.SaveRequestDetail(new CH_Request_DtlDTO() { Request_Dt = DateTime.Now, CardHolder_Id = CardHolderManager.GetLoggedInUser().CardHolder_Id, RequestType_Id = Convert.ToInt64(hideRequestTypeADDONId.Value), Relation = ddlRelation.SelectedValue, Gender = rbMale.Checked == true ? "M" : (rbFeMale.Checked == true ? "F" : (rbOther.Checked == true ? "Other" : null)), Addon_Profile_Photo = filename, DOB = DateTime.ParseExact(txtDOB.Text, "dd/mm/yyyy", null), Add_On_Card_Applicant = txtApplicantName.Text.Trim(), IP_Address = Request.UserHostAddress, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); } Mailfunction(RequestDtlID); Clearcontrols(); } 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) { string filename = ""; string saveFile = ""; int TotalAddons = 0; string IsaccountEligible = ""; try { bool IsAllowToAdd = CheckPendingRequest(); if (!IsAllowToAdd) { Clearcontrols(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.PendingRequestState + "');", true); return; } //Step 1 Check for addons IsaccountEligible = IsAccountEligible(); if (IsaccountEligible == "") { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.AccountNotEligible + "');", true); return; } TotalAddons = TotalAddonCards(); if (TotalAddons == 3) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + Constants.only3Addons + "');", true); return; } ///Step 2 Upload File if (photoUpload.HasFile) { var bytes = new byte[20]; photoUpload.PostedFile.InputStream.Read(bytes, 0, 20); if (!GeneralMethods.CheckFileHeader(photoUpload.FileName, bytes, EXTENSIONS_ATTACH)) { GeneralMethods.AlertMessage(Page, "Please Upload file having file type is .jpg or .jpeg or .png only"); return; } if (!System.IO.Directory.Exists(string.Format("{0}{1}\\{2}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, ADDON_FOLDER))) { System.IO.Directory.CreateDirectory(string.Format("{0}{1}\\{2}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, ADDON_FOLDER)); } filename = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(photoUpload.FileName); saveFile = string.Format("{0}{1}\\{2}\\{3}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, ADDON_FOLDER, filename); photoUpload.SaveAs(saveFile); } //Step 3 POST Request Detail Data 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), Relation = ddlRelation.SelectedValue, Gender = rbMale.Checked == true ? "M" : (rbFeMale.Checked == true ? "F" : null), Addon_Profile_Photo = filename, DOB = Convert.ToDateTime(txtDOB.Text), Add_On_Card_Applicant = txtApplicantName.Text.Trim(), IP_Address = Request.UserHostAddress, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); Mailfunction(RequestDtlID); Clearcontrols(); //lblMessage.Text = "Requset for Add-on card has been sent"; //lblMessage.CssClass = "msgsuccess"; } catch (Exception) { if (System.IO.File.Exists(saveFile)) { System.IO.File.Delete(saveFile); } lblMessage.Text = Constants.GeneralErrorMessage; lblMessage.CssClass = "error"; } }
/// <summary> /// This method is used to save ATM PIN details in database /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { int i = 0; bool validOTP = false; if (ViewState["OTPAttempt"] != null) { if (ViewState["OTPAttempt"].ToString() != string.Empty) { i = Convert.ToInt32(ViewState["OTPAttempt"]); } } try { string str = OTPCurrentValue.Value; if (txtOTP.Text == string.Empty || txtOTP.Text == null) { Label1.Text = "Please enter OTP"; Label1.Attributes.CssStyle.Add("display", "block"); divInvalidfeedback.Attributes.CssStyle.Add("display", "block"); divOTPSent.Attributes.CssStyle.Add("display", "none"); divremaining.Attributes.CssStyle.Add("display", "none"); divIncorrectOTP.Attributes.CssStyle.Add("display", "flex"); divOTP.Attributes.CssStyle.Add("display", "block"); ScriptManager.RegisterStartupScript(this, GetType(), "setValue", "setValue();", true); ScriptManager.RegisterStartupScript(this, GetType(), "UncheckValue", "UncheckValue();", true); return; } else { if (txtOTP.Text == OTPval && hideCreditAccNumber.Value != null && txtATMPIN.Text == "" && HiddenField1.Value == "") { SetNewPin.Visible = true; //SetNewPin.Attributes.CssStyle.Add("display", "block"); divPIN.Visible = true; validOTP = true; lblmsg.Text = "OTP Verified!"; divOTP.Attributes.CssStyle.Add("display", "none"); ScriptManager.RegisterStartupScript(this, GetType(), "setValue", "setValue();", true); validOTP = true; HiddenField1.Value = "1"; ScriptManager.RegisterStartupScript(this, GetType(), "UncheckValue", "UncheckValue();", true); } else if (txtOTP.Text == OTPval && hideCreditAccNumber.Value != null && txtATMPIN.Text != "" && txtConfirmATMPIN.Text != "" && validOTP == true) { SetNewPin.Visible = true; //SetNewPin.Attributes.CssStyle.Add("display", "block"); divPIN.Visible = true; validOTP = true; lblmsg.Text = "OTP Verified!"; divOTP.Attributes.CssStyle.Add("display", "none"); ScriptManager.RegisterStartupScript(this, GetType(), "setValue", "setValue();", true); validOTP = true; HiddenField1.Value = "1"; ScriptManager.RegisterStartupScript(this, GetType(), "UncheckValue", "UncheckValue();", true); } else if (txtOTP.Text != OTPval) { validOTP = false; i++; ViewState["OTPAttempt"] = i; lblOTPMessage.Text = Constants.IncorrectOTP; divIncorrectOTP.Attributes.CssStyle.Add("display", "flex"); divOTP.Attributes.CssStyle.Add("display", "block"); divOTPSent.Attributes.CssStyle.Add("display", "none"); divremaining.Attributes.CssStyle.Add("display", "none"); divInvalidfeedback.Attributes.CssStyle.Add("display", "block"); lblOTPMessage.Attributes.CssStyle.Add("display", "block"); Label1.Attributes.CssStyle.Add("display", "none"); ScriptManager.RegisterStartupScript(this, GetType(), "UncheckValue", "UncheckValue();", true); txtOTP.Text = string.Empty; txtOTP.Focus(); ScriptManager.RegisterStartupScript(this, GetType(), "setValue", "setValue();", true); //mvFrgtUname.ActiveViewIndex = 0; if (i == 3) { //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('" + "You entered the OTP incorrectly a maximum of 3 times." + "Please you may request for a new OTP by clicking on the Regenerate OTP" + "');", true); txtOTP.Text = ""; lblOTPMessage.Text = "You entered the OTP incorrectly a maximum of 3 times." + "Please you may request for a new OTP by clicking on the Regenerate OTP"; divIncorrectOTP.Attributes.CssStyle.Add("display", "flex"); divOTP.Attributes.CssStyle.Add("display", "block"); divOTPSent.Attributes.CssStyle.Add("display", "none"); divremaining.Attributes.CssStyle.Add("display", "none"); divInvalidfeedback.Attributes.CssStyle.Add("display", "block"); ScriptManager.RegisterStartupScript(this, GetType(), "setValue", "setValue();", true); ScriptManager.RegisterStartupScript(this, GetType(), "UncheckValue", "UncheckValue();", true); } return; } } if (Page.IsValid) { if (HiddenField1.Value == "1" && txtATMPIN.Text != "") { CHRequestDetailManager crdm = new CHRequestDetailManager(); ViewState["ATMPIN"] = txtATMPIN.Text; try { if (txtATMPIN.Text == txtConfirmATMPIN.Text && hideCreditAccNumber.Value != null) { 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, Created_dt = DateTime.Now, Created_by = CardHolderManager.GetLoggedInUser().CardHolder_Id, Request_Status = ConfigurationManager.AppSettings["DEFAULT_STATUS"].ToString() }); System.Threading.Thread.Sleep(1000); //ScriptManager.RegisterStartupScript(this, GetType(), "ShowProgress", "ShowProgress();", true); CreateRequest(txtATMPIN.Text, RequestDtlID); btnSubmit.Style.Remove("data-loading"); } else { LblError.Text = Constants.PINMismatch; LblError.Attributes.CssStyle.Add("display", "block"); divIncorrectOTP.Attributes.CssStyle.Add("display", "flex"); txtATMPIN.Text = ViewState["ATMPIN"].ToString(); divOTP.Attributes.CssStyle.Add("display", "none"); return; } } catch (Exception exp) { lblOTPMessage.Text = exp.Message; lblOTPMessage.Text = Constants.TechnicalError; } if (ViewState["ATMPIN"] == null) { txtATMPIN.Text = ViewState["ATMPIN"].ToString(); } } } else { divOTP.Attributes.CssStyle.Add("display", "none"); } } catch (Exception exp) { lblOTPMessage.Text = Constants.TechnicalError; } OTPCurrentValue.Value = string.Empty; }