protected void SubmitLoan() { string memberNo = Session["username"].ToString(); string lnProdType = ddlLoanProduct.SelectedValue; decimal lnAmnt = Convert.ToDecimal(txtBxLnAmnt.Text); string lnPurpose = ddlLoanPurpose.SelectedValue; int modOfDisbursmnt = Convert.ToInt32(ddlModeOfDisbursement.SelectedValue); int RepaymentFrq = Convert.ToInt32(ddlRepymntFreq.SelectedValue); decimal basicPay = Convert.ToDecimal(TxtBxBasicSalo.Text); decimal netPay = Convert.ToDecimal(txtBoxNetSalo.Text); decimal grossPay = Convert.ToDecimal(TxtBxGrossPay.Text); decimal hseAllwance = Convert.ToDecimal(TxtBxHouseAllowance.Text); decimal busFareAllwance = Convert.ToDecimal(TxtBxBusFareAllowance.Text); //decimal responsibilityAllwance = Convert.ToDecimal(TxtBxResponsibilityAllowances.Text); decimal otherIncome = Convert.ToDecimal(TxtBxOtherAllowances.Text); decimal NHIF = 0; string response = WSConfig.ObjNav.FnLoanApplication(memberNo, lnProdType, lnAmnt, lnPurpose, modOfDisbursmnt, RepaymentFrq, basicPay, netPay, hseAllwance, grossPay, busFareAllwance, otherIncome, NHIF, source); if (response == "SUCCESS") { SACCOFactory.ShowAlert("Loan application successful"); Response.Redirect("MyLoansList.aspx"); } }
protected void ddlLoanType_SelectedIndexChanged(object sender, EventArgs e) { ddlLoanProduct.Visible = true; ddlLoanProduct.SelectedIndex = 0; ddlLoanProduct.Items.Clear(); LoadLoanProducts(nav, ddlLoanProduct); string selLtype = ddlLoanType.SelectedItem.Text; if (selLtype.Equals("...select loan type....")) { SACCOFactory.ShowAlert("Invalid selection, select again"); } else if (selLtype.Equals("FOSA Loan")) { source = 0; } else if (selLtype.Equals("BOSA Loan")) { source = 1; } else { source = 2; } }
protected void btnsendback_Click(object sender, EventArgs e) { // sendFeedBack(); string memberno = Session["usernameJ"].ToString(); string messagetext = txtfeedback.Text.Trim(); try { var credentials = new NetworkCredential(ConfigurationManager.AppSettings["W_USER"], ConfigurationManager.AppSettings["W_PWD"], ConfigurationManager.AppSettings["DOMAIN"]); Portals sup = new Portals(); sup.Credentials = credentials; sup.PreAuthenticate = true; if (sup.FnFeedback(memberno, messagetext) == true) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "myFunction();", true); //ScriptManager.RegisterStartupScript(this, this.GetType(), "text", "alert('Feedback send succcessfully')", true); Loadfeedback(); } } catch (Exception ex) { //lblError.Text = ex.Message; SACCOFactory.ShowAlert(ex.Message); return; } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtPasswordOld.Text.Trim()) && String.IsNullOrEmpty(txtPasswordNew.Text.Trim()) && String.IsNullOrEmpty(txtPasswordConfirm.Text)) { SACCOFactory.ShowAlert("You must fill-in all the fields to continue"); return; } if (String.IsNullOrEmpty(txtPasswordNew.Text.Trim()) != String.IsNullOrEmpty(txtPasswordConfirm.Text)) { SACCOFactory.ShowAlert("New password is not equal to the confirm password field"); return; } try { if (WSConfig.ObjNav.FnChangePassword(Session["username"].ToString(), txtPasswordOld.Text.Trim(), txtPasswordConfirm.Text.Trim())) { SACCOFactory.ShowAlert("Password was succesfully changed"); } else { SACCOFactory.ShowAlert("Your password cannot be changed at the moment. Kindly contact your Sacco Helpdesk"); } } catch (Exception exception) { SACCOFactory.ShowAlert(exception.Message); } }
public void UpdateDetails(String loan) { try { NAV nav = new Config().ReturnNav(); var loanDetails = nav.LoansProductSetUp.Where(r => r.Code == loan); foreach (var loandetail in loanDetails) { String loanLimit = String.Format("{0:n}", Convert.ToDouble(loandetail.Max_Loan_Amount)); details.InnerHtml = "<tr><td>Loan Product</td><td>" + loandetail.Product_Description + "</td></tr>" + "<tr><td>Interest Rate</td><td>" + (loandetail.Interest_rate) / 12 + " % </td></tr>" + "<tr><td>Minimum Loan Amount</td><td>" + loandetail.Min_Loan_Amount + "</td></tr>" + "<tr><td>Maximum Installments</td><td>" + loandetail.No_of_Installment + "</td></tr>" + "<tr><td>Maximum Loan Amount</td><td>" + loanLimit + "</td></tr>" + "<tr><td>Repayment Method</td><td>" + loandetail.Repayment_Method + "</td></tr>" + "<tr><td>Repayment Frequency</td><td>" + loandetail.Repayment_Frequency + "</td></tr>"; } } catch (Exception ex) { SACCOFactory.ShowAlert("Connection Error! Try again later!"); } }
protected void ddlDuration_SelectedIndexChanged(object sender, EventArgs e) { if (ddlDuration.SelectedIndex == 0) { SACCOFactory.ShowAlert("Please select a valid duration"); //DateTime dtTime = DateTime.Now; //DateTime Onew = dtTime.AddMonths(1); //var monthOne = (Onew - dtTime).TotalDays; //var totalMonths = Math.Truncate((monthOne % 365) / 30); //SACCOFactory.ShowAlert(totalMonths + " month"); //} //else if (ddlDuration.SelectedIndex == 2) { // //DateTime Thrmon = dtTime.AddMonths(3); // //var monthTw = (Thrmon - dtTime).TotalDays; // //var totalThrMonths = Math.Truncate((monthTw % 365) / 30); // //SACCOFactory.ShowAlert(totalThrMonths + " Months"); //} //else if (ddlDuration.SelectedIndex == 3) //{ // //var Sixmo = dtTime.AddMonths(6); // //var monthSix = (Sixmo - dtTime).TotalDays; // //var totalThrMonths = Math.Truncate((monthSix % 365) / 30); // //SACCOFactory.ShowAlert(totalThrMonths + " Months"); //} //else if (ddlDuration.SelectedIndex == 4) //{ //} //else { // SACCOFactory.ShowAlert("Please select a valid date"); } }
//protected void ViewApprovalStatus() //{ // var chkapproverequests = nav.JointSignatoryApprovals.Where(n => n.ID_Number == Session["idnoJ"].ToString()).ToList(); // GridViewMyguaranteedloans.AutoGenerateColumns = false; // GridViewMyguaranteedloans.DataSource = chkapproverequests; // GridViewMyguaranteedloans.DataBind(); //} protected void lnkDecline_Click(object sender, EventArgs e) { string transno = (sender as LinkButton).CommandArgument; var chkstatus = Nav.JointSignatoryApprovals.ToList().Where(n => n.ID_Number == Session["idnoJ"].ToString() && n.Transaction_No == transno).Select(s => s.Status).SingleOrDefault(); switch (chkstatus) { case "Approved": SACCOFactory.ShowAlert("Sorry you have already Approved this request"); break; default: if (WSConfig.ObjNav.FnDeclineApprovalRequest(transno, Session["idnoJ"].ToString()) == true) { SACCOFactory.ShowAlert("Approval Decline Completed Successfully"); LoadApprovalRequests(); } else { SACCOFactory.ShowAlert("Approval Decline Unsuccessful"); } break; } }
protected void PasswordExpiry(string username) { var passDt = nav.MemberList.ToList().Where(r => r.No == username); var pdT = passDt.Select(r => r.Password_Reset_Date).SingleOrDefault(); switch (pdT.ToString()) { case null: Response.Redirect("Default.aspx"); break; default: DateTime pexpires = Convert.ToDateTime(pdT); var expTm = DateTime.Now; int timeEp = (expTm - pexpires).Minutes; if (timeEp > 2) { SACCOFactory.ShowAlert("Sorry, your OTP Code has expired, please reset first"); //ScriptManager.RegisterStartupScript(this, this.GetType(), "text", "alert('Sorry, your OTP Code has expired, please reset first')", true); //Response.Redirect("Default.aspx"); } break; } }
protected void btnTransfer_OnClick(object sender, EventArgs e) { string[] sdetails = ddFosAccounts.SelectedValue.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries); string accNo = sdetails[0]; string[] ddetails = ddAccounts.SelectedValue.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries); string destacNo = ddetails[0]; string descrption = txtTransDescrp.Text; string idnumber = Session["idnoJ"].ToString(); var docno = RandomDocNumber(); if (Convert.ToDecimal(txtAvailableBalance.Text.Trim()) - Convert.ToDecimal(txtTransferAmount.Text.Trim()) < 0) { SACCOFactory.ShowAlert( "Transfer not Allowed. Source A/c Balance Must be greator OR equal to 0 after the transfer."); return; } else { string result = WSConfig.ObjNav.FundsTransferFOSAJoint(accNo, destacNo, docno, Convert.ToDecimal(txtTransferAmount.Text.Trim()), descrption, idnumber, 1); if (result == "TRUE") { ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "myFunction();", true); } else { SACCOFactory.ShowAlert("REFERENCE NUMBER EXISTS!"); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { var nPassword = NewPassword(); var CompEmail = WSConfig.ObjNav.FnUpdatePassword(txtEmployeeNo.Text.Trim(), idNo.Text.Trim(), nPassword); if (WSConfig.MailFunction(string.Format("DEAR MEMBER,\n YOUR NEW PASSWORD IS {0}", nPassword), CompEmail, "PORTAL PASSWORD RESET") && !String.IsNullOrEmpty(CompEmail)) { SACCOFactory.ShowAlert( "A New Password has been generated and sent to your Personal mail.Kindly use to it to login to your Member portal"); } else { SACCOFactory.ShowAlert( "An error occurred while sending you a new password. Kindly consult ICT for more details."); } } catch (Exception exception) { SACCOFactory.ShowAlert(exception.Message); } btnSubmit.Visible = false; btnBack.Visible = false; btnPassword.Visible = true; btnLogin.Visible = true; MultiView1.SetActiveView(View1); }
private bool MyValidationFunction(string myusername, string mypassword) { bool boolReturnValue = false; string SQLRQST = @"select [No_], Password from [Kingdom Sacco Ltd_$Members Register]"; SqlConnection con = new SqlConnection(strSQLConn); SqlCommand command = new SqlCommand(SQLRQST, con); SqlDataReader Dr; try { con.Open(); Dr = command.ExecuteReader(); while (Dr.Read()) { if ((myusername == Dr["No_"].ToString()) && (mypassword == Dr["Password"].ToString())) { boolReturnValue = true; break; } if (string.IsNullOrWhiteSpace(Dr["Password"].ToString())) { boolReturnValue = false; } } Dr.Close(); } catch (SqlException ex) { SACCOFactory.ShowAlert("Authentication failed!" + ex.Message); } return(boolReturnValue); }
protected void updateMonthlyContributions( ) { string MbrNo = Session["username"].ToString(); string accNo = ddlDespositsAcc.SelectedValue; decimal amnt = Convert.ToDecimal(txBxNewDpstAmnt.Text); WSConfig.ObjNav.FnUpdateMonthlyContrib(MbrNo, amnt); SACCOFactory.ShowAlert("Monthly contributions successfully updated."); }
protected void tesClick() { var MobileString = txtPhoneNo.Text.Trim(); var mobileBuilder = new StringBuilder(MobileString); mobileBuilder.Remove(0, 1); mobileBuilder.Insert(0, "+254"); MobileString = mobileBuilder.ToString(); SACCOFactory.ShowAlert("Phone:" + MobileString); }
protected void ReasonForBlocking_Click(object sender, EventArgs e) { try { WSConfig.ObjNav.FnAtmBlocking(ddFosaAccount.SelectedValue, txtreasonforblocking.Text.Trim()); } catch (Exception exception) { SACCOFactory.ShowAlert(exception.Message); } }
protected void btnSubmit_Click(object sender, EventArgs e) { string userName = Session["usernameJ"].ToString(); string userId = Session["idnoJ"].ToString(); string curPass = txtPasswordOld.Text.Trim(); var navCurPass = nav.JointAccountLogin.Where(r => r.Account_No == userName && r.ID_No == userId).Select(r => r.Password).ToString(); if (curPass != navCurPass) { SACCOFactory.ShowAlert("Wrong current password!!"); lblError.Text = "Wrong current password!!"; return; } string passEncrypt = EncryptP(txtPasswordConfirm.Text); if (String.IsNullOrEmpty(txtPasswordOld.Text.Trim()) && String.IsNullOrEmpty(txtPasswordNew.Text.Trim()) && String.IsNullOrEmpty(txtPasswordConfirm.Text)) { SACCOFactory.ShowAlert("You must fill-in all the fields to continue"); return; } if (String.IsNullOrEmpty(txtPasswordNew.Text.Trim()) != String.IsNullOrEmpty(txtPasswordConfirm.Text)) { SACCOFactory.ShowAlert("New password is not matching the confirmed password field"); return; } if (txtPasswordNew.Text.Trim() != txtPasswordConfirm.Text.Trim()) { SACCOFactory.ShowAlert("Password mismatch"); lblError.Text = "Password Mismatch, please try again!"; return; } else { try { if (WSConfig.ObjNav.FnChangePasswordJointAccount(Session["usernameJ"].ToString(), txtPasswordOld.Text.Trim(), txtPasswordConfirm.Text.Trim())) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "myFunction();", true); } else { SACCOFactory.ShowAlert("Password could not be changed, kindly contact ICT Admin for assistance"); } } catch (Exception exception) { SACCOFactory.ShowAlert(exception.Message); } } }
protected void ReasonForBlocking__Click(object sender, EventArgs e) { try { WSConfig.ObjNav.FnAtmApplications(account: ddFosaAccount_.SelectedValue); } catch (Exception exception) { SACCOFactory.ShowAlert(exception.Message); return; } }
public void printLoanGurantortatement() { btnviewmbstat.Visible = false; btnviewloanguarantedrep.Visible = false; btnviewdepostat.Visible = false; btnviewloanstat.Visible = false; btnviewfosastat.Visible = false; try { var dt01 = txtSelStartD.Value.Trim(); DateTime dTOne = Convert.ToDateTime(dt01); var dt02 = txtSelEndD.Value.Trim(); DateTime dTe = Convert.ToDateTime(dt02); if (dTe < dTOne) { SACCOFactory.ShowAlert("Select a date GREATER than start date"); txtSelEndD.Value = ""; txtSelStartD.Value = ""; return; } } catch (Exception ex) { //SACCOFactory.ShowAlert("Please select correct dates!"); } if (txtSelEndD.Value == "" || txtSelStartD.Value == "") { return; } else { try { var filename = Session["usernameJointBosa"].ToString().Replace(@"/", @""); string dt1dt2 = txtSelStartD.Value.Trim() + ".." + txtSelEndD.Value.Trim(); { WSConfig.ObjNav.FnLoanGurantorsReport(Session["usernameJointBosa"].ToString(), String.Format("LOAN GUARANTORS_{0}.pdf", filename), dt1dt2); pdfReport.Attributes.Add("src", ResolveUrl("~/Downloads/" + String.Format("LOAN GUARANTORS_{0}.pdf", filename, dt1dt2))); } } catch (Exception exception) { exception.Data.Clear(); } } }
protected void lnkViewStats_Click(object sender, EventArgs e) { try { var fosaNO = Session["Fosa_no"].ToString(); FosaMultiview.SetActiveView(viewStatement); lblFosaAc.Text = fosaNO; } catch (Exception ex) { SACCOFactory.ShowAlert("Nothing selected!"); return; } }
protected void atmApplication__Click(object sender, EventArgs e) { try { WSConfig.ObjNav.FnAtmApplications(account: ddFosaAccount_.SelectedValue); SACCOFactory.ShowAlert("Atm Application for account: " + ddFosaAccount_.SelectedValue + "has been successfuly received"); } catch (Exception exception) { SACCOFactory.ShowAlert(exception.Message); return; } }
protected void lnkAccept_Click(object sender, EventArgs e) { string transno = (sender as LinkButton).CommandArgument; if (WSConfig.ObjNav.FnAcceptApprovalRequest(transno, Session["idnoJ"].ToString()) == true) { SACCOFactory.ShowAlert("You have Successfully Approved this transaction"); LoadApprovalRequests(); } else { SACCOFactory.ShowAlert("Approval Unsuccessfull"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { //string userName = Session["username"].ToString(); //string curPass= txtPasswordOld.Text.Trim(); //var navCurPass = nav.HR_Employees.Where(r=>r.No==userName).Select(r => r.Password).ToString(); //if (curPass != navCurPass) { // HRFactory.ShowAlert("Wrong current password!!"); // lblError.Text = "Wrong current password!!"; // return; //} if (String.IsNullOrEmpty(txtPasswordOld.Text.Trim()) && String.IsNullOrEmpty(txtPasswordNew.Text.Trim()) && String.IsNullOrEmpty(txtPasswordConfirm.Text)) { SACCOFactory.ShowAlert("You must fill-in all the fields to continue"); return; } if (String.IsNullOrEmpty(txtPasswordNew.Text.Trim()) != String.IsNullOrEmpty(txtPasswordConfirm.Text)) { SACCOFactory.ShowAlert("New password is not equal to the confirm password field"); return; } if (txtPasswordNew.Text.Trim() != txtPasswordConfirm.Text.Trim()) { SACCOFactory.ShowAlert("Password mismatch"); lblError.Text = "Password Mismatch, please try again!"; return; } else { try { if (WSConfig.ObjNav.FnChangePassword(Session["username"].ToString(), txtPasswordOld.Text.Trim(), txtPasswordConfirm.Text.Trim())) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "myFunction();", true); } else { SACCOFactory.ShowAlert("Your password could not be changed, kindly contact ICT Admin for assistance"); } } catch (Exception exception) { SACCOFactory.ShowAlert(exception.Message); } } }
protected void btnviewloanguarantedrep_Click(object sender, EventArgs e) { try { var dt01 = txtSelStartD.Value.Trim(); DateTime dTOne = Convert.ToDateTime(dt01); var dt02 = txtSelEndD.Value.Trim(); DateTime dTe = Convert.ToDateTime(dt02); if (dTe < dTOne) { SACCOFactory.ShowAlert("Select a date GREATER than start date"); txtSelEndD.Value = ""; txtSelStartD.Value = ""; return; } } catch (Exception ex) { SACCOFactory.ShowAlert("Please select correct dates!"); } if (txtSelEndD.Value == "" || txtSelStartD.Value == "") { return; } else { try { var filename = Session["usernameJointBosa"].ToString().Replace(@"/", @""); string dt1dt2 = txtSelStartD.Value.Trim() + ".." + txtSelEndD.Value.Trim(); { WSConfig.ObjNav.FnLoanGuranteed(Session["usernameJointBosa"].ToString(), String.Format("LOANS GUARANTEED_{0}.pdf", filename), dt1dt2); pdfReport.Attributes.Add("src", ResolveUrl("~/Downloads/" + String.Format("LOANS GUARANTEED_{0}.pdf", filename, dt1dt2))); } } catch (Exception exception) { exception.Data.Clear(); } } }
protected void SaveStandingOrders() { //try{ string bsaNo = Session["username"].ToString(); string accNo = drplstSrcAccNo.SelectedValue; string freq = ddlFrequency.SelectedValue; string duration = ddlDuration.SelectedValue; int acTp = 0; string actype = ddlDestAccType.SelectedItem.Text; string destacNo = ""; if (actype == "Internal") { acTp = 0; destacNo = ddlDestAccName.SelectedValue; } else if (actype == "External") { acTp = 1; destacNo = txtBxDestAcc.Text; } else if (actype == "BOSA") { acTp = 2; destacNo = ddlDestAccName.SelectedValue; } string amount = txtAmount.Text; decimal amt = Convert.ToDecimal(amount); DateTime startDate = Convert.ToDateTime(txtSotStartDate.Text); DateTime NowTime = DateTime.Now; int startDateError = DateTime.Compare(startDate, NowTime); if (startDateError < 0) { SACCOFactory.ShowAlert("Adjust Start Date be today or later"); } WSConfig.ObjNav.FnStandingOrders(bsaNo, accNo, freq, duration, destacNo, startDate, amt, acTp); SACCOFactory.ShowAlert("Standing Order Created successfully!"); //} // catch(Exception ex){ // // SACCOFactory.ShowAlert("There was an error in creating this standing order"); // } }
protected void btnViewFState_Click(object sender, EventArgs e) { try { var dt01 = txtSelStartD.Value.Trim(); DateTime dTOne = Convert.ToDateTime(dt01); var dt02 = txtSelEndD.Value.Trim(); DateTime dTe = Convert.ToDateTime(dt02); if (dTe < dTOne) { SACCOFactory.ShowAlert("Select a date GREATER than start date"); txtSelEndD.Value = ""; txtSelStartD.Value = ""; return; } } catch (Exception ec) { SACCOFactory.ShowAlert("Please select correct dates!"); } if (txtSelEndD.Value == "" || txtSelStartD.Value == "") { return; } else { try { var filename = Session["username"].ToString().Replace(@"/", @""); string dt1dt2 = txtSelStartD.Value.Trim() + ".." + txtSelEndD.Value.Trim(); WSConfig.ObjNav.FnFosaStatement(lblFosaAc.Text, String.Format("FOSA STATEMENT_{0}.pdf", filename), dt1dt2); pdfReport.Attributes.Add("src", ResolveUrl("~/Downloads/" + String.Format("FOSA STATEMENT_{0}.pdf", filename, dt1dt2))); } catch (Exception ex) { SACCOFactory.ShowAlert("An Error Occured, please contact System Administrator!"); } } }
protected void btnviewdepostat_Click(object sender, EventArgs e) { try { var dt01 = txtSelStartD.Value.Trim(); DateTime dTOne = Convert.ToDateTime(dt01); var dt02 = txtSelEndD.Value.Trim(); DateTime dTe = Convert.ToDateTime(dt02); if (dTe < dTOne) { SACCOFactory.ShowAlert("Select a date GREATER than start date"); txtSelEndD.Value = ""; txtSelStartD.Value = ""; return; } } catch (Exception ec) { SACCOFactory.ShowAlert("Please select correct dates!"); } if (txtSelEndD.Value == "" || txtSelStartD.Value == "") { return; } else { var filename = Session["username"].ToString().Replace(@"/", @""); string dt1Dt2 = txtSelStartD.Value.Trim() + ".." + txtSelEndD.Value.Trim(); try { WSConfig.ObjNav.FnDepositsStatement(Session["username"].ToString(), String.Format("DEPOSITS STATEMENT_{0}.pdf", filename), dt1Dt2); pdfReport.Attributes.Add("src", ResolveUrl("~/Downloads/" + String.Format("DEPOSITS STATEMENT_{0}.pdf", filename, dt1Dt2))); } catch (Exception exception) { exception.Data.Clear(); } } }
protected void SwitchKinMinor() { DateTime dobminor; DateTime NowTime = DateTime.Now; var kdb = kindob.Value; if (string.IsNullOrWhiteSpace(kdb)) { SACCOFactory.ShowAlert("Please Select date of birth"); kindob.Focus(); return; } else { dobminor = DateTime.Parse(kdb); } int startDateError = DateTime.Compare(dobminor, NowTime); if (startDateError > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "text", "refreshkin()", true); return; } registerMultiView.SetActiveView(refereedetails); DeactivateThings(); LoadSession(); ScriptManager.RegisterStartupScript(this, this.GetType(), "text", "minorNxtofKin()", true); //SACCOFactory.ShowAlert(Session["kinlstname"].ToString()); var idNokinGuard = TextGIdno.Text; var idTypekinG = ddlguardianIdPas.SelectedItem.Text; GetIPRSData(idTypekinG, idNokinGuard, 3); //previewdatanow Session["guardianid"] = pretxtKGid.Text; Session["guardianname"] = TxtGname.Text; Session["guardianDOB"] = TxtGdob.Text; pretxtKMinorname.Text = Session["KinMinorName"].ToString(); pretxtGphone.Text = Session["GuardianPhone"].ToString(); // pretxtKMinorname.Text = "F**k uo"; }
//protected override void CreateChildControls() //{ // base.CreateChildControls(); // ctrlGoogleReCaptcha.PublicKey = "6LdK7j4UAAAAAJaWiKryMXWxVcwuDAyjEb_Kr204"; // ctrlGoogleReCaptcha.PrivateKey = "6LdK7j4UAAAAAC1ovoMUpMxXODnYYsWaebjMbbf0"; //} protected void btnLogin_Click(object sender, EventArgs e) { cptCaptcha.ValidateCaptcha(txtCaptcha.Text.Trim()); if (cptCaptcha.UserValidated) { string userName = txtStaffNo.Text.Trim().Replace("'", ""); string userPassword = txtPassword.Text.Trim().Replace("'", ""); string mypassencrypt = EncryptP(userPassword); try { if (string.IsNullOrWhiteSpace(userPassword)) { lblError.Text = "Password Empty!"; SACCOFactory.ShowAlert("Password Empty!"); return; } if (MyValidationFunction(userName, mypassencrypt)) { Session["username"] = userName; Session["pwd"] = mypassencrypt; Session["accType"] = "individual"; Response.Redirect("Dashboard.aspx"); } else { lblError.Text = "Authentication failed!"; SACCOFactory.ShowAlert("Authentication failed!, Try Again"); } } catch (Exception exception) { lblError.Text = exception.Message; return; } } else { lblError.Text = "Invalid Captcha.Try again!!"; } }
protected void btnView_Click(object sender, EventArgs e) { var loansNumber = ddlLoanStatement.SelectedValue; if (ddlLoanStatement.SelectedIndex == 0) { SACCOFactory.ShowAlert("Please select a valid Loan"); return; } var filename = Session["username"].ToString().Replace(@"/", @""); try { PrintLoansStatement(loansNumber); pdfReport.Attributes.Add("src", ResolveUrl("~/Downloads/" + String.Format("LOAN STATEMENT_{0}.pdf", filename))); SACCOFactory.ShowAlert(loansNumber); } catch (Exception exception) { exception.Data.Clear(); } }
protected void checkPassDate() { var passDt = nav.MemberList.ToList().Where(r => r.No == Session["username"].ToString()); string pdT = passDt.Select(r => r.Password_Set_Date).SingleOrDefault().ToString(); string idNo = passDt.Select(r => r.ID_No).SingleOrDefault().ToString(); string passWDInit = passDt.Select(k => k.Password).SingleOrDefault().ToString(); DateTime Pexpires = Convert.ToDateTime(pdT); var expDay = DateTime.Today; int daysT = (expDay - Pexpires).Days; //SACCOFactory.ShowAlert("pass " + passWDInit); if (daysT >= 25 && daysT <= 30 || idNo.Equals(passWDInit) || Pexpires == null) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); } else if (daysT > 30) { // Response.Redirect("Logout"); SACCOFactory.ShowAlert("Sorry, your password has expired, reset first!"); } }
protected void viewEndDate_SelectionChanged(object sender, EventArgs e) { DateTime dTOne = Convert.ToDateTime(txtSelStartDT.Text); txtSelEndDT.Text = viewEndDate.SelectedDate.ToString("MM/dd/yy"); DateTime dTe = Convert.ToDateTime(txtSelEndDT.Text); viewEndDate.Visible = false; if (dTe < dTOne) { SACCOFactory.ShowAlert("Select a date GREATER than start date"); txtSelEndDT.Text = ""; return; } //else if (!string.IsNullOrEmpty(txtSelEndDT.Text)) //{ //} //else { // SACCOFactory.ShowAlert("Wrong!"); //} }