/// <summary> /// Loads the page. /// </summary> /// <remarks></remarks> private void LoadPage() { try { lblDisplayMessage.Visible = false; string strReq = ""; strReq = Request.Form["txtPostData"]; if (!strReq.Equals("")) { strReq = EncryptDecryptQueryString.Decrypt(strReq, qsk); } string[] arrMsgs = strReq.Split('&'); string[] arrIndMsg; arrIndMsg = arrMsgs[0].Split('='); //Get the Details string[] Details; Details = arrIndMsg[1].Split(','); if (Details != null) { lblTransactionNum.Text = Convert.ToString(Details[0].Trim()); lbltxnDateTime.Text = Convert.ToString(Details[1].Trim()); lblCardnumber.Text = Convert.ToString(Details[2].Trim()); lblName.Text = Convert.ToString(Details[3].Trim()); lblamount.Text = Convert.ToString(Details[4].Trim()); lblModePayment.Text = Convert.ToString(Details[5].Trim()); } } catch { lblDisplayMessage.Visible = true; lblDisplayMessage.InnerText = Constants.GeneralErrorMessage; } }
/// <summary> /// Handles the Click event of the btnEnter 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 btnEnter_Click(object sender, EventArgs e) { if (IsValidInfo()) { string Appnum = txtAppNumber.Text.Trim(); if (!string.IsNullOrEmpty(Appnum)) { string fn = string.Format(queryString, Appnum); string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); ScriptManager.RegisterStartupScript(this, GetType(), "DisplayApp", "DisplayApplication('" + urlQueryString + "');", true); //btnEnter.Attributes.Add("OnClick", "return DisplayApplication('" + urlQueryString + "');"); } else { lblerror.Text = "Please enter application number"; } } else { lblerror.Text = Constants.InvalidCaptcha; txtCaptchaFirst.Text = string.Empty; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["ProductID"] == null) { Response.Redirect("Home.aspx"); } string DecriptedText = new EncryptDecryptQueryString().Decrypt(HttpUtility.UrlDecode(Request.QueryString["ProductID"])); int ProductID = Convert.ToInt32(DecriptedText); //Find Corresponding product Product p = ProductHandler.GetProductByID(ProductID); if (p == null) { Response.Clear(); Response.StatusCode = 404; Response.End(); // throw new HttpException(404,"PageNotFound"); } HdnProductId.Value = ProductID.ToString(); NameTxt.Text = p.Name; StockTxt.Text = p.Stock.ToString(); PriceTxt.Text = p.Price.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { Int32 OfficeId = 1234; Int32 FormId = 12; string Dist = "ABD"; string Tal = "MAN"; string OtherSession = "OIP"; string Userid = "1234"; string RoleName = "RO"; string RoleId = "ROH"; string username = "******"; EncryptDecryptQueryString _encrDecrpOBJ = new EncryptDecryptQueryString(); //string EOfficeId = _encrDecrpOBJ.Encrypt(OfficeId.ToString (), ConfigurationManager.AppSettings["GenericKey"]); //string EFormId = _encrDecrpOBJ.Encrypt(FormId.ToString(), ConfigurationManager.AppSettings["GenericKey"]); //string EDistId = _encrDecrpOBJ.Encrypt(Dist.ToString(), ConfigurationManager.AppSettings["GenericKey"]); //string ETalId = _encrDecrpOBJ.Encrypt(Tal.ToString(),ConfigurationManager.AppSettings["GenericKey"]); //string EOtherSession = _encrDecrpOBJ.Encrypt(OtherSession.ToString(), ConfigurationManager.AppSettings["GenericKey"]); //string EUserid = _encrDecrpOBJ.Encrypt(Userid.ToString(), ConfigurationManager.AppSettings["GenericKey"]); //string ERoleName = _encrDecrpOBJ.Encrypt(RoleName.ToString(), ConfigurationManager.AppSettings["GenericKey"]); //string ERoleId = _encrDecrpOBJ.Encrypt(RoleId.ToString(), ConfigurationManager.AppSettings["GenericKey"]); //and then Pass value in query strinng string url = "OfficeId=" + OfficeId.ToString() + "&Formid=" + FormId.ToString() + "&DistCode=" + Dist.ToString() + "&TalCode=" + Tal.ToString() + "&OtherSession=" + OtherSession.ToString() + "&RoleId=" + RoleId.ToString() + "&RoleName=" + RoleName.ToString() + "&UserId=" + Userid.ToString() + "&UserName="******"GenericKey"]); Response.Redirect("GenericQuery.aspx?" + url); }
/// <summary> /// Loads the page. /// </summary> /// <remarks></remarks> private void LoadPage() { try { lblDisplayMessage.Visible = false; string strReq = ""; //strReq = Request.RawUrl; strReq = Request.Form["txtPostData"]; // strReq = strReq.Substring(strReq.IndexOf('?') + 1); if (!strReq.Equals("")) { strReq = EncryptDecryptQueryString.Decrypt(strReq, qsk); } string pdfPath = GetFilePath(); string[] arrMsgs = strReq.Split('&'); string[] arrIndMsg; arrIndMsg = arrMsgs[0].Split('='); //Get the Name string filename = arrIndMsg[1].ToString().Trim(); //string FilePath = directory + filename; if (File.Exists(pdfPath + filename)) { Response.ContentType = pdfContentType; Response.AppendHeader(contentDisposition, attachmentFileName + filename); //Response.TransmitFile(Server.MapPath(pdfPath + FileName)); //If path is virtual path Response.TransmitFile(pdfPath + filename); //If path is physical path Response.End(); } } catch { lblDisplayMessage.Visible = true; lblDisplayMessage.InnerText = Constants.ErrorMsg1; } }
public string CriarChave(UrlHelper Url) { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); string chaveCriptografada = Cripto.Criptografar(string.Format("planoId={0}", Id), Chave); var novo = Url.Action("PreCadastro", "Adesao", new { chaveUrl = chaveCriptografada }, Esquema); return(novo); }
public void Validar(UrlHelper url) { Url = url; EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); string key = "r10X310y"; UrlEditar = Url.Action("Editar", "GestaoDocumento", new { chaveurl = Cripto.Criptografar(string.Format("id={0}", Id), key) }); }
public void Validar(UrlHelper url) { Url = url; EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); UrlEditar = Url.Action("UsuarioFrm", new { chaveurl = Cripto.Criptografar(string.Format("idUsuario={0}&Acao=Alterar", Id), Key) }); UrlExcluir = Url.Action("UsuarioFrm", new { chaveurl = Cripto.Criptografar(string.Format("idUsuario={0}&Acao=Excluir", Id), Key) }); }
public void Validar() { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); UrlEditar = Url.Action("PapelFrm", new { chaveurl = Cripto.Criptografar(string.Format("idPapel={0}&Acao=Alterar", Id), Key) }); UrlExcluir = Url.Action("PapelFrm", new { chaveurl = Cripto.Criptografar(string.Format("idPapel={0}&Acao=Excluir", Id), Key) }); }
public void Validar(UrlHelper Url) { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); string key = "r10X310y"; UrlEditar = Url.Action("Editar", new { chaveurl = Cripto.Criptografar(string.Format("id={0}", ID), key) }); UrlExcluir = Url.Action("Excluir", new { chaveurl = Cripto.Criptografar(string.Format("id={0}", ID), key) }); }
public void Validar() { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); string key = "r10X310y"; UrlEditar = Url.Action("ListaDocumentosFrm", "Documento", new { chaveurl = Cripto.Criptografar(string.Format("id={0}&Acao=Alterar", ID), key) }); UrlExcluir = Url.Action("ListaDocumentosFrm", "Documento", new { chaveurl = Cripto.Criptografar(string.Format("id={0}&Acao=Excluir", ID), key) }); }
protected void RptProductList_ItemCommand(object source, RepeaterCommandEventArgs e) { string ProductID = e.CommandArgument.ToString(); if (e.CommandName == "UpdateProduct") { string EncryptedProductID = new EncryptDecryptQueryString().Encrypt(ProductID); Response.Redirect(string.Format("UpdateProduct.aspx?ProductID={0}", HttpUtility.UrlEncode(EncryptedProductID))); //Response.Redirect("UpdateProduct.aspx?ProductID="+ProductID); } else if (e.CommandName == "DeleteProduct") { new ProductHandler().DeleteProduct(Convert.ToInt32(ProductID)); Response.Redirect("ViewProduct.aspx"); } }
public static EnviadosVM ModelToViewModel(Compartilhamentos comp, UrlHelper url) { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); EnviadosVM enviado = new EnviadosVM(); enviado.MeusCompartilhamentosId = comp.ID; enviado.EnviadoEm = Convert.ToDateTime(comp.ENVIADO_EM).ToString(); enviado.Assunto = comp.ASSUNTO; enviado.QtdDocs = comp.DocumentosCompartilhados.GroupBy(d => d.PJPF_DOCUMENTO_ID).Count(); enviado.Disponibilidade = !comp.SEM_PRAZO ? Convert.ToDateTime(comp.VALIDADE).ToShortDateString() : "Sem Prazo"; string para = ""; foreach (dynamic docs in comp.WFD_DESTINATARIO.ToList()) { if (!docs.EMAIL_AVULSO) { para += docs.NOME; } else { para += docs.EMAIL; } para += ", "; } if (para.Length > 25) { para = para.Substring(0, 25) + "..."; } else if (para.Length > 2) { para = para.Substring(0, para.Length - 2); } enviado.Para = para; enviado.UrlVer = url.Action("EnviadosFrm", "MeusDocumentos", new { chaveurl = Cripto.Criptografar(string.Format("idComp={0}", comp.ID.ToString()), "r10X310y") }); return(enviado); }
public void Validar() { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); UrlEditar = Url.Action("AplicacaoEditarFrm", "Aplicacao", new { chaveurl = Cripto.Criptografar(string.Format("idAplicacao={0}", Id), Key) }); UrlDetalhar = Url.Action("AplicacaoDetalharFrm", "Aplicacao", new { chaveurl = Cripto.Criptografar(string.Format("idAplicacao={0}", Id), Key) }); UrlExcluir = Url.Action("Delete", "Aplicacao", new { chaveurl = Cripto.Criptografar(string.Format("idAplicacao={0}", Id), Key) }); }
protected void Page_Load(object sender, EventArgs e) { string Appnum = Convert.ToString(Session["AppHashNum"]); if (!string.IsNullOrEmpty(Appnum)) { divbtn.Visible = true; successMsg.Text = "An email with given application number has been sent to your email id. Please save that for future reference"; lblMessage.Text = Constants.AppSuccess + "Your application number is: " + Appnum.Decrypt(); string fn = string.Format(queryString, Appnum.Decrypt()); string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); btnprintform.Attributes.Add("OnClick", "return DisplayApplication('" + urlQueryString + "');"); Session["AppHashNum"] = null; } else { Response.Redirect("Login.aspx", true); } }
public void Validar() { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); string key = "r10X310y"; UrlEditar = Url.Action("CategoriaFrm", "Categoria", new { chaveurl = Cripto.Criptografar(string.Format("id={0}&Acao=Alterar", ID), key) }); UrlExcluir = Url.Action("CategoriaFrm", "Categoria", new { chaveurl = Cripto.Criptografar(string.Format("id={0}&Acao=Excluir", ID), key) }); UrlNovaSubCategoria = Url.Action("CategoriaFrm", "Categoria", new { chaveurl = Cripto.Criptografar(string.Format("id={0}&Acao=NovaSubcategoria", ID), key) }); }
public ActionResult Editar(string chaveurl) { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); var id = Cripto.Descriptografar(chaveurl, Key); var descripto = new Criptografia(EnumCripto.LinkDescriptografar, chaveurl, "r10X310y"); var retorno = 0; var parametroCriptografia = descripto.Resultados.FirstOrDefault(x => x.Key == "id"); if (parametroCriptografia.Value != null) { int.TryParse(parametroCriptografia.Value, out retorno); } CadastroDocumentoFornecedorIndividualVM modelo = new CadastroDocumentoFornecedorIndividualVM(); using (WebForLinkContexto contexto = new WebForLinkContexto()) { modelo = CadastroDocumentoFornecedorIndividualVM.ModelToViewModel(contexto.WFD_PJPF_DOCUMENTOS.FirstOrDefault(x => x.ID == retorno)); } return(View(modelo)); }
private string GetApplicationNum() { ApplicationNum = ""; try { string strReq = ""; strReq = Request.Form["txtPostData"]; if (!strReq.Equals("")) { strReq = EncryptDecryptQueryString.Decrypt(strReq, qsk); } string[] arrMsgs = strReq.Split('&'); string[] arrIndMsg; arrIndMsg = arrMsgs[0].Split('='); //Get the Details ApplicationNum = Convert.ToString(arrIndMsg[1]); return(ApplicationNum); } catch (Exception) { return(ApplicationNum); } }
public static List <MeusDocumentosVM> ModelToViewModel(List <DocumentosDoFornecedor> meusDocumentos, UrlHelper Url) { EncryptDecryptQueryString Cripto = new EncryptDecryptQueryString(); List <MeusDocumentosVM> meusDocumentoVM = Mapper.Map <List <MeusDocumentosVM> >(meusDocumentos); meusDocumentoVM.ForEach(x => { //x.DescricaoDocumento = x.DescricaoDocumento.DiminuirEAdicionarTresPontosADescricaoDeDocumento(60); x.UrlArquivo = Url.Action("MeusDocumentosArquivo", "MeusDocumentos", new { chaveurl = Cripto.Criptografar(string.Format("idDoc={0}&local=Interno", x.ID.ToString()), "r10X310y") }); x.UrlEditar = Url.Action("MeusDocumentosFrm", "MeusDocumentos", new { chaveurl = Cripto.Criptografar(string.Format("id={0}&Acao=Alterar", x.ID.ToString()), "r10X310y") }); x.UrlExcluir = Url.Action("MeusDocumentosFrm", "MeusDocumentos", new { chaveurl = Cripto.Criptografar(string.Format("id={0}&Acao=Excluir", x.ID.ToString()), "r10X310y") }); }); return(meusDocumentoVM); }
/// <summary> /// Processes the response from bobibanking. /// </summary> /// <param name="msgResponse">The MSG response.</param> /// <remarks></remarks> //private void ProcessResponseFromBobibanking(string msgResponse) //{ // string rootFilePath = GetBobibankingKeyPath(); // string bobKeyFilePath = rootFilePath + Constants.bobibankingFileName.Trim(); // string msg = BobibankingEncryptionDecryption.Decrypt(msgResponse, bobKeyFilePath); // var bobibankingResponse = new BobibankingResponse(msg); // try // { // string StartCardnumber1 = ""; // string EndCardnumber1 = ""; // string EncCardNumber = ""; // double amount = 0; // string PRN = string.Empty; // string bid = string.Empty; // string debtAccountNo = string.Empty; // string itc = string.Empty; // string retVal = string.Empty; // bool transactionUpdateStatus = false; // string accountNumber = CreditAccNumber; //changes by Sahil on 22'Dec14 // string cardnumber = CreditCardNumber.Decrypt(); // Added by Sahil on 22'Dec14 // if (cardnumber != "") // { // // cardnumber = cardnumber.Decrypt(); // StartCardnumber1 = cardnumber.Substring(0, 4); // if (cardnumber.Length == 16) // EndCardnumber1 = cardnumber.Substring(13, 3); // } // EncCardNumber = StartCardnumber1 + "XXXXXXXXX" + EndCardnumber1; // string paymentStatus = bobibankingResponse.IsTransactionValid(); // amount = Convert.ToDouble(bobibankingResponse.AMT); // if (bobibankingResponse.BID != null) bid = bobibankingResponse.BID; // PRN = bobibankingResponse.PRN; // debtAccountNo = bobibankingResponse.ACNT_NUM; // itc = bobibankingResponse.ITC; // retVal = SaveCardHolderPaymentStatusForBobibanking(null, PRN, accountNumber, amount, PID, bid, debtAccountNo, 2, paymentStatus); // if (retVal != "") // transactionUpdateStatus = true; // //if (paymentStatus.ToLower() != success) // //{ // // LoadPage(); // // //DisplayMessage(Constants.Error4, true); // // DisplayMessage(paymentStatus, true); // // return; // //} // if (paymentStatus.ToLower() == success && transactionUpdateStatus == true) // { // //DisplayMessage("For your card " + EncCardNumber + " having account number " + accountNumber.Decrypt() + ", Payment of Rs." + amount + " executed successfully.Your transaction number for further reference is : " + PRN + ".Thank you for payment.", true); // DisplayMessage("The payment of Rs." + amount + " for card number " + EncCardNumber + "has been processed successfully. The transaction reference number is " + PRN + ".Thank you for payment.", true); // divDisplayAll.Visible = false; // lkbRedirectToCardStatement.Visible = true; // btnPrint.Visible = true; // btnPrintBillDesk.Visible = false; // string dt = DateTime.Now.ToString(); // string amt = Convert.ToString(amount); // string mode = "Bank of Baroda Net Banking"; // string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode }; // string fn = string.Format(queryString, objParams); // string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); // btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');"); // } // else if (paymentStatus.ToLower() == success && transactionUpdateStatus == false) // { // DisplayMessage(Constants.Error5 + " Your transaction number for further reference is: " + PRN, true); // divDisplayAll.Visible = false; // lkbRedirectToCardStatement.Visible = true; // btnPrint.Visible = true; // btnPrintBillDesk.Visible = false; // string dt = DateTime.Now.ToString(); // string amt = Convert.ToString(amount); // string mode = "Bank of Baroda Net Banking"; // string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode }; // string fn = string.Format(queryString, objParams); // string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); // btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');"); // } // else // { // LoadPage(); // DisplayMessage(paymentStatus, true); // lkbRedirectToCardStatement.Visible = false; // return; // } // //if (paymentStatus.ToLower() == success && retVal != "") // //{ // // System.Threading.Thread.Sleep(10000); // // CreateRequest(amount, "B"); // //} // } // catch (Exception) // { // LoadPage(); // DisplayMessage(Constants.GeneralErrorMessage, true); // lkbRedirectToCardStatement.Visible = false; // return; // } //} private void ProcessResponseFromBobibankingNew(string msgResponse) { BOBSymmetricCipherHelper sch = new BOBSymmetricCipherHelper(); string incom_data = sch.getURLDecoded(msgResponse); string key = "29304E875832789229304E8758327892"; try { string StartCardnumber1 = ""; string EndCardnumber1 = ""; string EncCardNumber = ""; double amount = 0; string PRN = string.Empty; string bid = string.Empty; string PID = string.Empty; string debtAccountNo = string.Empty; string ITC = string.Empty; string retVal = string.Empty; bool transactionUpdateStatus = false; string BRN = string.Empty; string accountNumber = CreditAccNumber; //changes by Sahil on 22'Dec14 string cardnumber = CreditCardNumber.Decrypt(); // Added by Sahil on 22'Dec14 if (cardnumber != "") { // cardnumber = cardnumber.Decrypt(); StartCardnumber1 = cardnumber.Substring(0, 4); if (cardnumber.Length == 16) { EndCardnumber1 = cardnumber.Substring(13, 3); } } EncCardNumber = StartCardnumber1 + "XXXXXXXXX" + EndCardnumber1; byte[] inputStrBytes = sch.decode(incom_data); String outp = Encoding.UTF8.GetString(Decrypt(inputStrBytes, GetRijndaelManaged(key))); var bobibankingResponseNew = new BobibankingResponseNew(outp); string[] data = outp.Split('&'); string strCheckSum = data[data.Length - 1].Split('=')[1]; string hashgendata = data[0] + "&" + data[1] + "&" + data[2] + "&" + data[3] + "&" + data[4] + "&" + data[5] + "&" + data[6]; string paymentStatus = bobibankingResponseNew.IsTransactionValidNew(); amount = Convert.ToDouble(bobibankingResponseNew.AMT); PRN = data[2].Split('=')[1]; debtAccountNo = data[6].Split('=')[1]; ITC = data[3].Split('=')[1]; PID = Constants.PID; BRN = data[1].Split('=')[1]; /// this is for Payment verification if (paymentStatus == "Success") { paymentStatus = VerifyTranscation(bobibankingResponseNew.AMT, PRN, ITC, PID, BRN); } retVal = SaveCardHolderPaymentStatusForBobibanking(null, PRN, accountNumber, amount, PID, bid, debtAccountNo, 2, paymentStatus); if (retVal != "") { transactionUpdateStatus = true; } if (paymentStatus.ToString() == "Success" && transactionUpdateStatus == true) { DisplayMessage("The payment of Rs." + amount + " for card number " + EncCardNumber + "has been processed successfully. The transaction reference number is " + PRN + ".Thank you for payment.", true); divDisplayAll.Visible = false; lkbRedirectToCardStatement.Visible = true; btnPrint.Visible = true; btnPrintBillDesk.Visible = false; string dt = DateTime.Now.ToString(); string amt = Convert.ToString(amount); string mode = "Bank of Baroda Net Banking"; string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode }; string fn = string.Format(queryString, objParams); string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');"); } else if (paymentStatus.ToLower() == "Success" && transactionUpdateStatus == false) { DisplayMessage(Constants.Error5 + " Your transaction number for further reference is: " + PRN, true); divDisplayAll.Visible = false; lkbRedirectToCardStatement.Visible = true; btnPrint.Visible = true; btnPrintBillDesk.Visible = false; string dt = DateTime.Now.ToString(); string amt = Convert.ToString(amount); string mode = "Bank of Baroda Net Banking"; string[] objParams = { PRN, dt, EncCardNumber, CardHolderName, amt, mode }; string fn = string.Format(queryString, objParams); string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); btnPrint.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');"); } else { LoadPage(); if (paymentStatus == "InValidEmptyString") { paymentStatus = "InValid: Bobibanking Response Has Empty String. Please try again or contact Bank."; } else if (paymentStatus == "Invalidchecksum") { paymentStatus = "Invalid: " + "Payment not successful. Please try again or contact Bank."; } else if (paymentStatus == "Cancelled") { paymentStatus = "Bobibanking transaction is cancelled due to some reason.Please try again or contact Bank."; } DisplayMessage(paymentStatus, true); lkbRedirectToCardStatement.Visible = false; return; } } catch (Exception ex) { } }
/// <summary> /// Loads the page. /// </summary> /// <remarks></remarks> private void LoadPage() { //string strReq = ""; //strReq = Request.RawUrl; //strReq = strReq.Substring(strReq.IndexOf('?') + 1); //if (!strReq.Equals("")) // strReq = EncryptDecryptQueryString.Decrypt(strReq, qsk); //string directory = GetFilePath(); //string[] arrMsgs = strReq.Split('&'); //string[] arrIndMsg; //arrIndMsg = arrMsgs[0].Split('='); //Get the Name //string filename = arrIndMsg[1].ToString().Trim(); //string FilePath = directory + filename; //byte[] fileBytes = File.ReadAllBytes(FilePath); //MemoryStream stream = new MemoryStream(fileBytes); //Response.ContentType = pdfContentType; //Response.AddHeader(contentDisposition, inlineAttachment + FilePath); //Response.AddHeader(contentLength, stream.Length.ToString()); //Response.BinaryWrite(stream.ToArray()); //Response.End(); bool IsAccHavePdf = false; string strReq = ""; string AccountNumber = CardHolderManager.GetLoggedInUser().creditcard_acc_number.Decrypt(); if (AccountNumber != "") { //strReq = Request.RawUrl; strReq = Request.Form["txtPostData"]; if (!strReq.Equals("")) { strReq = EncryptDecryptQueryString.Decrypt(strReq, qsk); } string directory = GetFilePath(); string[] arrMsgs = strReq.Split('&'); string[] arrIndMsg; arrIndMsg = arrMsgs[0].Split('='); //Get the Name string filename = arrIndMsg[1].ToString().Trim(); IsAccHavePdf = CardManager.GetPDFnames(AccountNumber, filename); if (IsAccHavePdf == true) { string FilePath = directory + filename; byte[] fileBytes = File.ReadAllBytes(FilePath); MemoryStream stream = new MemoryStream(fileBytes); Response.ContentType = pdfContentType; Response.AddHeader(contentDisposition, inlineAttachment + FilePath); Response.AddHeader(contentLength, stream.Length.ToString()); Response.BinaryWrite(stream.ToArray()); Response.End(); } else { Response.Write(Constants.NoPdfFound); } } //else //{ // string strjava = "<script language='javascript' type='text/javascript'>"; // strjava += "window.parent.location.reload();"; // strjava += "</script>"; // Response.Write(strjava); //} }
/// <summary> /// Handles the RowDataBound event of the grdCardStatement control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewRowEventArgs"/> instance containing the event data.</param> /// <remarks></remarks> //protected void grdCardStatement_RowDataBound(object sender, GridViewRowEventArgs e) protected void lstViewCardStatement_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { bool IsAccHavePdf = false; string FileName = ""; string AccountNumber = CardHolderManager.GetLoggedInUser().creditcard_acc_number.Decrypt(); Label LblNoPdf = (Label)e.Item.FindControl(LblNoPDfId); Label LblNoPrint = (Label)e.Item.FindControl(lblnoPrintId); Label lblPDFName = (Label)e.Item.FindControl(lblPDFNameControlId); if (lblPDFName.Text.Trim() != "") { FileName = Convert.ToString(lblPDFName.Text.Trim()); } //CH_EVG_EVENTS_QUEUEDTO objPDF = new CardManager().GetCardStatementPDFFileName(cardNumber, Convert.ToDateTime(lblStatementDate.Text)); //if (objPDF != null && objPDF.EVE_OUT_FILENAME != string.Empty) // FileName = Convert.ToString(objPDF.EVE_OUT_FILENAME); LinkButton ibtnPrint = (LinkButton)e.Item.FindControl(printControlId); LinkButton ibtnDownload = (LinkButton)e.Item.FindControl(downloadControlId); string pdfPath = ""; if (Session[sessionFilePath] == null) { pdfPath = GetFilePath(); Session[sessionFilePath] = pdfPath; } else if (Session[sessionFilePath] != null) { pdfPath = Convert.ToString(Session[sessionFilePath]); } if (!string.IsNullOrEmpty(FileName)) { IsAccHavePdf = CardManager.GetPDFnames(AccountNumber, FileName); if (IsAccHavePdf == true) { if (File.Exists(pdfPath + FileName)) { LblNoPdf.Visible = false; LblNoPrint.Visible = false; ibtnPrint.Enabled = true; ibtnDownload.Enabled = true; ibtnPrint.ToolTip = printPDFToolTip; ibtnDownload.ToolTip = downloadPDFToolTip; string fn = string.Format(queryString, FileName); string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); ibtnPrint.Attributes.Add("OnClick", "return DisplayPDF('" + urlQueryString + "');"); ibtnDownload.Attributes.Add("OnClick", "return DwnloadPDF('" + urlQueryString + "');"); } else { LblNoPdf.Visible = true; LblNoPrint.Visible = true; ibtnDownload.Visible = false; ibtnPrint.Visible = false; LblNoPdf.ToolTip = Constants.fileNotFound; LblNoPrint.ToolTip = Constants.fileNotFound; } } else { LblNoPdf.Visible = true; LblNoPrint.Visible = true; ibtnDownload.Visible = false; ibtnPrint.Visible = false; LblNoPdf.ToolTip = Constants.fileNotFound; LblNoPrint.ToolTip = Constants.fileNotFound; } } else { LblNoPdf.Visible = true; LblNoPrint.Visible = true; ibtnDownload.Visible = false; ibtnPrint.Visible = false; LblNoPdf.ToolTip = Constants.fileNotFound; LblNoPrint.ToolTip = Constants.fileNotFound; } } }
public string EncryptQueryString(string strQueryString) { EncryptDecryptQueryString objEDQueryString = new EncryptDecryptQueryString(); return(objEDQueryString.Encrypt(strQueryString, "r0b1nr0y")); }
public string EncryptQueryString(string strQueryString) { EncryptDecryptQueryString objEDQueryString = new EncryptDecryptQueryString(); return objEDQueryString.Encrypt(strQueryString, "r0b1nr0y"); }
private string DecryptQueryString(string strQueryString) { EncryptDecryptQueryString objEDQueryString = new EncryptDecryptQueryString(); return(objEDQueryString.Decrypt(strQueryString, "r0b1nr0y")); }
/// <summary> /// Processes the response. /// </summary> /// <param name="msgResponse">The MSG response.</param> /// <remarks></remarks> private void ProcessResponseFromBillDesk(string msgResponse) { string msg = msgResponse; BillDeskResponse BillDeskResponse = new BillDeskResponse(msg); try { string StartCardnumber1 = ""; string EndCardnumber1 = ""; string EncCardNumber = ""; string tranactionNumber = ""; double transactionAmount = 0; // string accountNumber = ""; string BillDeskOnlineID = ""; string TxnRefrenceNo = ""; string retVal = ""; bool transactionUpdateStatus = false; string cardnumber = CreditCardNumber.Decrypt(); // Added by Sahil on 22'Dec14 if (cardnumber != "") { // cardnumber = cardnumber.Decrypt(); StartCardnumber1 = cardnumber.Substring(0, 4); if (cardnumber.Length == 16) { EndCardnumber1 = cardnumber.Substring(13, 3); } } EncCardNumber = StartCardnumber1 + "XXXXXXXXX" + EndCardnumber1; string paymentStatus = BillDeskResponse.IsTransactionValid(); tranactionNumber = BillDeskResponse.CustomerID; transactionAmount = Convert.ToDouble(BillDeskResponse.TxtAmount); //accountNumber = BillDeskResponse.AdditionalInfo1; // Updated on 20-Jan-2015 BillDeskOnlineID = BillDeskResponse.AdditionalInfo1; TxnRefrenceNo = BillDeskResponse.TxnRefrenceNo; string BankRefNo = BillDeskResponse.BankReferenceNo; string BankId = BillDeskResponse.BankID; string AuthStatus = BillDeskResponse.AuthStatus; retVal = SaveCardHolderPaymentStatus(null, tranactionNumber, BillDeskOnlineID, transactionAmount, TxnRefrenceNo, 2, paymentStatus, BankRefNo, BankId, AuthStatus); // Update the transaction in sql if (retVal != "") { transactionUpdateStatus = true; } //if (paymentStatus.ToLower() != success) //{ // LoadPage(); // DisplayMessage(Constants.Error4, true); // return; //} if (paymentStatus.ToLower() == success && transactionUpdateStatus == true) { DisplayMessage("The payment of Rs." + transactionAmount + " for card number " + EncCardNumber + "has been processed successfully. The transaction reference number is " + tranactionNumber + ".Thank you for payment.", true); divDisplayAll.Visible = false; lkbRedirectToCardStatement.Visible = true; btnPrint.Visible = false; btnPrintBillDesk.Visible = true; string dt = DateTime.Now.ToString(); string amt = Convert.ToString(transactionAmount); string mode = "Other Bank Net Banking"; string[] objParams = { tranactionNumber, dt, EncCardNumber, CardHolderName, amt, mode }; string fn = string.Format(queryString, objParams); string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); btnPrintBillDesk.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');"); } else if (paymentStatus.ToLower() == success && transactionUpdateStatus == false) { DisplayMessage(Constants.Error5 + " Your transaction number for further reference is : " + tranactionNumber, true); divDisplayAll.Visible = false; lkbRedirectToCardStatement.Visible = true; btnPrint.Visible = false; btnPrintBillDesk.Visible = true; string dt = DateTime.Now.ToString(); string amt = Convert.ToString(transactionAmount); string mode = "Other Bank Net Banking"; string[] objParams = { tranactionNumber, dt, EncCardNumber, CardHolderName, amt, mode }; string fn = string.Format(queryString, objParams); string urlQueryString = EncryptDecryptQueryString.Encrypt(fn, qsk); btnPrintBillDesk.Attributes.Add("OnClick", "return DisplaySlip('" + urlQueryString + "');"); } else { LoadPage(); DisplayMessage(paymentStatus, true); lkbRedirectToCardStatement.Visible = false; return; } } catch (Exception) { LoadPage(); DisplayMessage(Constants.GeneralErrorMessage, true); //divDisplayAll.Visible = true; lkbRedirectToCardStatement.Visible = false; return; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //String SSOAppID = _encrDecrpOBJ.Encrypt(ConfigurationManager.AppSettings["SSOAppID"]); //and then Pass value in query strinng EncryptDecryptQueryString _encrDecrpOBJ = new EncryptDecryptQueryString(); Entity.FormMaster objConfigurationHead = new Entity.FormMaster(); //string converted = Request.QueryString.ToString();//Request.QueryString.ToString().Replace("/", ""); ////converted = converted.Replace("+", ""); //converted = converted.Replace("%", ""); //string qrystring = converted, ConfigurationManager.AppSettings["GenericKey"]); if (Request.QueryString["OfficeId"] != null && Request.QueryString["OfficeId"] != string.Empty) { Session["OfficeId"] = Request.QueryString["OfficeId"].ToString(); objConfigurationHead.OfficeName = Session["OfficeId"].ToString(); } if (Request.QueryString["DistCode"] != null && Request.QueryString["DistCode"] != string.Empty) { Session["DistCode"] = Request.QueryString["DistCode"].ToString(); objConfigurationHead.DistName = Session["DistCode"].ToString(); } if (Request.QueryString["TalCode"] != null && Request.QueryString["TalCode"] != string.Empty) { Session["TalCode"] = Request.QueryString["TalCode"].ToString(); objConfigurationHead.TalName = Session["TalCode"].ToString(); } if (Request.QueryString["OtherSession"] != null && Request.QueryString["OtherSession"] != string.Empty) { Session["OtherSession"] = Request.QueryString["OtherSession"].ToString(); objConfigurationHead.OtherSession = Session["OtherSession"].ToString(); } if (Request.QueryString["Formid"] != null && Request.QueryString["Formid"] != string.Empty) { Session["Formid"] = Request.QueryString["Formid"].ToString(); Session["MenuId"] = Session["Formid"]; objConfigurationHead.FormId = Convert.ToInt32(Session["Formid"]); } if (Request.QueryString["RoleId"] != null && Request.QueryString["RoleId"] != string.Empty) { Session["RoleId"] = Request.QueryString["RoleId"].ToString(); objConfigurationHead.Roleid = Session["RoleId"].ToString(); } if (Request.QueryString["RoleName"] != null && Request.QueryString["RoleName"] != string.Empty) { Session["RoleName"] = Request.QueryString["RoleName"].ToString(); objConfigurationHead.RoleName = Session["RoleName"].ToString(); } if (Request.QueryString["UserId"] != null && Request.QueryString["UserId"] != string.Empty) { Session["UserId"] = Request.QueryString["UserId"].ToString(); objConfigurationHead.UserId = Convert.ToInt32(Session["UserId"].ToString()); } if (Request.QueryString["UserName"] != null && Request.QueryString["UserName"] != string.Empty) { Session["UserName"] = Request.QueryString["UserName"].ToString(); objConfigurationHead.UserName = Session["UserName"].ToString(); } int check = BAL.FormMastermgmt.AddSessionLog(objConfigurationHead); if (check == 1) { Response.Redirect("Formfilling.aspx"); } } }