private string GenerateShortURLID() { String result = ""; Boolean isResultOK = false; while (isResultOK == false) { Random rnd = new Random(); int id = rnd.Next(); result = MyEncryption.Encrypt(id.ToString(), 5); var shortUrlId = db.ShortURLs .Where(b => b.Short_URLID == result) .FirstOrDefault(); if (shortUrlId == null) { isResultOK = true; } } return(result); }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink logstatus = (HyperLink)e.Row.FindControl("showStatusLog"); string enpValue = MyEncryption.Encrypt(this.GridView1.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); logstatus.NavigateUrl = "~/pages/clients/clienthome.aspx?loanAppid=" + enpValue; } }
protected void gvAccounts_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string enpValue = MyEncryption.Encrypt(this.gvAccounts.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); HyperLink link = (HyperLink)e.Row.FindControl("hyperAppProcess"); if (type == "initialassesment") { link.NavigateUrl = "~/pages/loanapplication/initialassesment.aspx?id=" + enpValue; } if (type == "preapproved") { link.NavigateUrl = "~/pages/loanapplication/preapproved.aspx?id=" + enpValue; } else if (type == "appraisals") { link.NavigateUrl = "~/pages/loanapplication/appraisals.aspx?id=" + enpValue; } else if (type == "approval") { link.NavigateUrl = "~/pages/loanapplication/approvals.aspx?id=" + enpValue; } else if (type == "approvedloans") { link.NavigateUrl = "~/pages/loanapplication/approvedloans.aspx?id=" + enpValue; } else if (type == "review") { link.NavigateUrl = "~/pages/loanapplication/review.aspx?id=" + enpValue; } else if (type == "disbursement") { link.NavigateUrl = "~/pages/finance/disbursement.aspx?id=" + enpValue; } else if (type == "risk") { link.NavigateUrl = "~/pages/loanapplication/risk.aspx?id=" + enpValue; } else if (type == "legal") { link.NavigateUrl = "~/pages/loanapplication/legal.aspx?id=" + enpValue; } HyperLink AlertLink = (HyperLink)e.Row.FindControl("hyperAlert"); AlertLink.NavigateUrl = "javascript:loadAlertPop('" + enpValue + "')"; if (setReview(Convert.ToInt32(this.gvAccounts.DataKeys[e.Row.RowIndex].Value.ToString()))) { e.Row.Cells[4].Text = "<i class='glyphicon glyphicon-ok'></i>"; } else { } } }
protected void gvTransactionClientList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string enpValue = MyEncryption.Encrypt(this.gvTransactionClientList.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); HyperLink link = (HyperLink)e.Row.FindControl("HyperEntry"); link.NavigateUrl = HttpContext.Current.Request.Url.AbsoluteUri + "?id=" + enpValue + "&action=entry"; } }
protected void gvApplication_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string enpValue = MyEncryption.Encrypt(this.gvApplication.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); HyperLink link = (HyperLink)e.Row.FindControl("HyperTrail"); link.NavigateUrl = "~/pages/applicationtracker.aspx?id=" + enpValue; } }
protected void gvAccounts_RowDataBound1(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { //HyperLink Loan = (HyperLink)e.Row.FindControl("hyperLoan"); HyperLink Inv = (HyperLink)e.Row.FindControl("hyperInv"); string enpValue = MyEncryption.Encrypt(this.gvAccounts.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); //Loan.NavigateUrl = "~/pages/clients.aspx?product=loan&id=" + enpValue; Inv.NavigateUrl = "~/pages/loanaccountdetails.aspx?id=" + enpValue + ""; } }
protected void gvAccounts_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink clientProfile = (HyperLink)e.Row.FindControl("hyperClientProfile"); HyperLink Inv = (HyperLink)e.Row.FindControl("hyperInv"); string enpValue = MyEncryption.Encrypt(this.gvAccounts.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); clientProfile.NavigateUrl = "~/pages/clients/clienthome.aspx?id=" + enpValue; Inv.NavigateUrl = "javascript:apply('" + enpValue + "')"; } }
protected void gvInvClients_RowDataBound(object sender, GridViewRowEventArgs e) { try { HyperLink link = (HyperLink)e.Row.FindControl("HyperAppProcess"); if (e.Row.RowType == DataControlRowType.DataRow) { string enpValue = MyEncryption.Encrypt(gvInvClients.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); if (type == "initInterview") { link.NavigateUrl = "~/pages/invapplication/initInterview.aspx?id=" + enpValue; } if (type == "receipt") { link.NavigateUrl = "~/pages/invapplication/receipt.aspx?id=" + enpValue; } else if (type == "certification") { link.NavigateUrl = "~/pages/invapplication/certification.aspx?id=" + enpValue; } else if (type == "approved") { link.NavigateUrl = "~/pages/invapplication/approved.aspx?id=" + enpValue; } else if (type == "intMaturity") { link.NavigateUrl = "~/pages/invapplication/interestmaturity.aspx?id=" + enpValue; } else if (type == "invMaturity") { link.NavigateUrl = "~/pages/invapplication/review.aspx?id=" + enpValue; } else if (type == "matured") { link.NavigateUrl = "~/pages/invapplication/matured.aspx?id=" + enpValue; } HyperLink AlertLink = (HyperLink)e.Row.FindControl("hyperAlert"); AlertLink.NavigateUrl = "javascript:loadAlertPop('" + enpValue + "')"; if (setReview(Convert.ToInt32(this.gvInvClients.DataKeys[e.Row.RowIndex].Value.ToString()))) { e.Row.Cells[4].Text = "<i class='glyphicon glyphicon-ok'></i>"; } else { } } } catch (Exception ex) { } }
protected void gvUsers_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[0].Text = gvUsers.DataKeys[e.Row.RowIndex]["title"].ToString() + " " + gvUsers.DataKeys[e.Row.RowIndex]["datFirstnames"].ToString() + " " + gvUsers.DataKeys[e.Row.RowIndex]["datSurname"].ToString(); string enpValue = MyEncryption.Encrypt(this.gvUsers.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); HyperLink accessright = (HyperLink)e.Row.FindControl("hyperAccess"); accessright.NavigateUrl = "~/backend/pages/users.aspx?id=" + enpValue + "&page=accessright"; HyperLink roles = (HyperLink)e.Row.FindControl("hyperRoles"); roles.NavigateUrl = "~/backend/pages/users.aspx?id=" + enpValue + "&page=roles"; HyperLink updates = (HyperLink)e.Row.FindControl("hyperUpdates"); updates.NavigateUrl = "~/backend/pages/users.aspx?id=" + enpValue + "&page=updates"; } }
public string setUrls(int AppID) { Utility util = new Utility(); string url = ""; LoanDSTableAdapters.LoanApplicationsTableAdapter loanapp = new LoanDSTableAdapters.LoanApplicationsTableAdapter(); int status = Convert.ToInt32(loanapp.getApplicationStatus(AppID).ToString()); if (status == 2) { url = "~/pages/loanapplication/initialassesment.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } else if (status == 3) { url = "~/pages/loanapplication/preapproved.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } else if (status == 4) { url = "~/pages/loanapplication/appraisals.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } else if (status == 5) { url = "~/pages/loanapplication/risk.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } else if (status == 6) { url = "~/pages/loanapplication/legal.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } else if (status > 6 || status < 12) { url = "~/pages/loanapplication/approvals.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } else if (status == 12) { url = "~/pages/loanapplication/approvedloans.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } else if (status > 12 || status < 16) { url = "~/pages/loanapplication/disbursement.aspx?id=" + MyEncryption.Encrypt(AppID.ToString(), "12345678910"); } return(url); }
/// <summary> /// This Method Encrypts Any Value To String With Specific Ways Described In The Type /// </summary> /// <example>string Encryption.Encrypt("BlaBlaBla",Ecryptiontypes.FormAuth);</example> public static string Encrypt(string strToEncrypt, Encryptiontypes type) { string back = ""; try { switch (type) { case Encryptiontypes.Mine: MyEncryption my = new MyEncryption(); back = my.Encrypt(strToEncrypt); break; case Encryptiontypes.FormAuth: Encryption en = new Encryption(); back = en.EncryptFrmAuth(strToEncrypt); break; case Encryptiontypes.Des: SymmCrypto sy = new SymmCrypto(SymmCrypto.SymmProvEnum.DES); back = sy.Encrypting(strToEncrypt, ""); break; case Encryptiontypes.Rijndal: SymmCrypto syy = new SymmCrypto(SymmCrypto.SymmProvEnum.Rijndael); back = syy.Encrypting(strToEncrypt, ""); break; default: break; } } catch { back = ""; } return(back); }
protected void gvClients_RowDataBound(object sender, GridViewRowEventArgs e) { mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter(); if (e.Row.RowType == DataControlRowType.DataRow) { int terms = 0; InvestmentAccountDSTableAdapters.GetInvAccountTableAdapter InvAcc = new InvestmentAccountDSTableAdapters.GetInvAccountTableAdapter(); InvestmentAccountDS.GetInvAccountDataTable tblInvAcc = InvAcc.GetInvAccount(Convert.ToInt32(gvClients.DataKeys[e.Row.RowIndex].Value)); string enpValue = MyEncryption.Encrypt(this.gvClients.DataKeys[e.Row.RowIndex].Value.ToString(), "12345678910"); DateTime dt = DateTime.Parse(gvClients.DataKeys[e.Row.RowIndex]["datValueDate"].ToString()); e.Row.Cells[0].Text = client.GetClientsName(Convert.ToInt32(gvClients.DataKeys[e.Row.RowIndex]["datClientID"].ToString())).ToString(); e.Row.Cells[4].Text = util.displayValue("opt_investment_types", gvClients.DataKeys[e.Row.RowIndex]["datInvestmentType"].ToString()); terms = Convert.ToInt32(util.displayValue("opt_terms", gvClients.DataKeys[e.Row.RowIndex]["datFrequencyOfInterestPayment"].ToString())); int freq = Convert.ToInt32(gvClients.DataKeys[e.Row.RowIndex]["datFrequencyOfInterestPayment"].ToString()); Panel ItemBox = new Panel(); ItemBox.Attributes.Add("id", "div" + this.gvClients.DataKeys[e.Row.RowIndex].Value.ToString()); ItemBox.Attributes.Add("id", "div" + this.gvClients.DataKeys[e.Row.RowIndex].Value.ToString()); ItemBox.Attributes.Add("class", "ItemContainer"); ItemBox.Style.Add("display", "none"); string htmlContent = "<div class='col-md-9' style='padding-top:0'><label> Matured Interest(s) </label><br/>"; if (tblInvAcc[0].dat30 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=30&val=" + tblInvAcc[0].dat30.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 30).ToString("dd/MM/yyyy") + "</a> <br/>"; } if (tblInvAcc[0].dat60 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=60&val=" + tblInvAcc[0].dat60.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 60).ToString("dd/MM/yyyy") + "</a> <br/>"; } if (tblInvAcc[0].dat91 > 0 && freq == 2) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=91&val=" + tblInvAcc[0].dat91.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 90).ToString("dd/MM/yyyy") + "</a> <br/>"; } if (tblInvAcc[0].dat121 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=121&val=" + tblInvAcc[0].dat121.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 121).ToString("dd/MM/yyyy") + "</a> <br/>"; } if (tblInvAcc[0].dat151 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=151&val=" + tblInvAcc[0].dat151.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 151).ToString("dd/MM/yyyy") + "</a> <br/>"; } if (tblInvAcc[0].dat182 > 0 && freq == 3) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=182&val=" + tblInvAcc[0].dat182.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 182).ToString("dd/MM/yyyy") + "</a> <br/>"; } if (tblInvAcc[0].dat212 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=212&val=" + tblInvAcc[0].dat212.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 212).ToString("dd/MM/yyyy") + " </a> <br/>"; } if (tblInvAcc[0].dat242 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/iinterestmaturity.aspx?id=" + enpValue + "&schID=242&val=" + tblInvAcc[0].dat242.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 242).ToString("dd/MM/yyyy") + " </a> <br/>"; } if (tblInvAcc[0].dat273 > 0 && freq == 2) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=273&val=" + tblInvAcc[0].dat273.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 273).ToString("dd/MM/yyyy") + " </a> <br/>"; } if (tblInvAcc[0].dat303 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=303&val=" + tblInvAcc[0].dat303.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 303).ToString("dd/MM/yyyy") + " </a> <br/>"; } if (tblInvAcc[0].dat333 > 0 && freq == 1) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=333&val=" + tblInvAcc[0].dat333.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 303).ToString("dd/MM/yyyy") + " </a> <br/>"; } if (tblInvAcc[0].dat364 > 0 && freq == 4) { htmlContent += "<a href=../pages/invaccount/interestmaturity.aspx?id=" + enpValue + "&schID=364&val=" + tblInvAcc[0].dat364.ToString() + ">Int. Maturity for " + addDaysElapsed(dt, 364).ToString("dd/MM/yyyy") + " </a> <br/>"; } htmlContent += "</div>"; Literal ItemContent = new Literal(); ItemContent.Text = htmlContent; ItemBox.Controls.Add(ItemContent); HyperLink hyp = new HyperLink(); hyp.NavigateUrl = "javascript:showinfo('div" + this.gvClients.DataKeys[e.Row.RowIndex].Value.ToString() + "')"; hyp.Text = e.Row.Cells[0].Text; e.Row.Cells[0].Controls.Add(hyp); e.Row.Cells[0].Controls.Add(ItemBox); //HyperLink clientProfile = (HyperLink)e.Row.FindControl("hyperClientProfile"); //HyperLink Inv = (HyperLink)e.Row.FindControl("hyperInv"); } }
public string EncryptMine(string val) { MyEncryption my = new MyEncryption(); return(my.Encrypt(val)); }
protected void Page_Load(object sender, EventArgs e) { if (MySessionManager.AppID > 0) { this.itemLoanApp.Visible = true; this.ItemLoanAccount.Visible = false; LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter(); MySessionManager.ClientID = Convert.ToInt32(loanApp.getClientID(MySessionManager.AppID)); try { mainDSTableAdapters.GetApplicationInfoTableAdapter appinfo = new mainDSTableAdapters.GetApplicationInfoTableAdapter(); mainDS.GetApplicationInfoDataTable tblAppInfo = appinfo.GetApplicationInfo(MySessionManager.AppID); if (tblAppInfo.Rows.Count > 0) { this.btnEditApp.HRef = setUrls(MySessionManager.AppID); this.btnViewAppTracker.HRef = "~/pages/applicationtracker.aspx?id=" + MyEncryption.Encrypt(MySessionManager.AppID.ToString(), "12345678910"); if (tblAppInfo[0].IsdatLoanAmountNull() == false) { this.lnAmt.InnerText = tblAppInfo[0].datLoanAmount.ToString("c").Replace("$", ""); } if (tblAppInfo[0].IsdatLoanTypeNull() == false) { this.lnType.InnerText = tblAppInfo[0].datLoanType.ToString(); } if (tblAppInfo[0].IsdatApplicationStatusNull() == false) { this.lnAppStatus.InnerText = tblAppInfo[0].datApplicationStatus.ToString(); } if (tblAppInfo[0].IsdatDurationNull() == false) { this.lnDuration.InnerText = tblAppInfo[0].datDuration.ToString() + " month(s)"; } if (tblAppInfo[0].IsdatBranchNull() == false) { this.lnAppBranch.InnerText = tblAppInfo[0].datBranch.ToString(); } if (tblAppInfo[0].IsdatApplicationDateNull() == false) { this.lnAppDate.InnerText = tblAppInfo[0].datApplicationDate.ToLongDateString(); } } } catch (Exception ex) { } } else if (MySessionManager.AccountID > 0) { this.ItemLoanAccount.Visible = true; this.itemLoanApp.Visible = false; LoanAccountDSTableAdapters.GetLoanAccountTableAdapter loanAcc = new LoanAccountDSTableAdapters.GetLoanAccountTableAdapter(); MySessionManager.ClientID = Convert.ToInt32(loanAcc.GetClientIDFromAcc(Convert.ToInt32(MySessionManager.AccountID))); try { mainDSTableAdapters.GetLoanAccountInfoTableAdapter accinfo = new mainDSTableAdapters.GetLoanAccountInfoTableAdapter(); mainDS.GetLoanAccountInfoDataTable tblAccInfo = accinfo.GetLoanAccountInfo(Convert.ToInt32(MySessionManager.AccountID)); if (tblAccInfo.Rows.Count > 0) { if (tblAccInfo[0].IsdatOutstandingAmountNull() == false) { this.lnOutstanding.InnerText = tblAccInfo[0].datOutstandingAmount.ToString("c").Replace("$", ""); } if (tblAccInfo[0].IsdatStartDateNull() == false) { this.lnStartDate.InnerText = tblAccInfo[0].datStartDate.ToLongDateString(); } if (tblAccInfo[0].IsdatEndDateNull() == false) { this.lnEndDate.InnerText = tblAccInfo[0].datEndDate.ToLongDateString(); } if (tblAccInfo[0].IsdatBranchNull() == false) { this.lnAccBranch.InnerText = tblAccInfo[0].datBranch.ToString(); } this.btnTransactions.HRef = "~/pages/transactions.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=entry"; this.btnViewStatement.HRef = "~/pages/loanaccount/loanaccountdetails.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=2"; this.btnMonitorAccount.HRef = "~/pages/loanaccount/loanaccountdetails.aspx?id" + MyEncryption.Encrypt(MySessionManager.AccountID.ToString(), "12345678910") + "&action=1"; } } catch (Exception ex) { } } try { mainDSTableAdapters.GetClientInfoTableAdapter clientInfo = new mainDSTableAdapters.GetClientInfoTableAdapter(); mainDS.GetClientInfoDataTable tblClientInfo = clientInfo.GetClientInfo(MySessionManager.ClientID); if (tblClientInfo.Rows.Count > 0) { if (tblClientInfo[0].IsdatClientNameNull() == false) { clientname.InnerText = tblClientInfo[0].datClientName.ToString(); } if (tblClientInfo[0].IsdatClientNumberNull() == false) { clientNo.InnerText = tblClientInfo[0].datClientNumber.ToString(); } if (tblClientInfo[0].IsdatMobileNumber1Null() == false) { clMobile.InnerText = tblClientInfo[0].datMobileNumber1.ToString(); } } } catch (Exception ex) { } }