private void ProcesarRechazo() { if (Request["egp_data"] != null && Request.QueryString["IdIventure"] != null) { Core.Iventure iventure = FacadeDao.GetIventure(Convert.ToInt32(Request.QueryString["IdIventure"])); if (iventure != null) { //string data = Core.NpsEncripterHelper.Decrypt(Request["egp_data"], ConfigurationManager.AppSettings["Key"]); string data = Core.NpsEncripterHelper.Decrypt(Request["egp_data"], iventure.Proveedor.ClaveEncNPS); string[] campos = data.Split("|".ToCharArray()); string codigo = "-11111", idIventure = "-11111"; for (int i = 0; i < campos.Length; i++) { if (campos[i].StartsWith("egp_ResponseCode=")) { codigo = campos[i].Substring("egp_ResponseCode=".Length); } else if (campos[i].StartsWith("egp_OrderID=")) { idIventure = campos[i].Substring("egp_OrderID=".Length); } } string descripcion = CodigosNPS.GetDescripcion(Convert.ToInt32(codigo)); lblData.Text = "Nro de Solicitud: " + idIventure + "<br/>Código: " + codigo + "<br/>Descripción: " + descripcion; } } else if (Request["egp_data"] == null) { lblData.Text = "No se encontraron valores en egp_data"; } else { //(Request.QueryString["IdIventure"]!=null) lblData.Text = "No se encontraron valores en IdIventure"; } }
private void BindLista() { StringBuilder sql = new StringBuilder(); try { int?idCliente = null, idProveedor = null; if (Session["Cliente"] != null) { idCliente = ((Cliente)(Session["Cliente"])).Id; idProveedor = ((Cliente)(Session["Cliente"])).Proveedor.Id; grilla.Columns[0].Visible = false; //Cliente grilla.Columns[1].Visible = true; //Empresa } else if (Session["Proveedor"] != null) { idProveedor = ((Proveedor)(Session["Proveedor"])).Id; grilla.Columns[0].Visible = true; //Cliente grilla.Columns[1].Visible = false; //Empresa } else { idProveedor = -1; } int?idVendedor = null; if (((Usuario)(Session["Usuario"])).IsVendedor) { idVendedor = ((Usuario)(Session["Usuario"])).Id; } //Se invoca a este metodo par reemplazar al job de actualizacion ActualizarEstados(); List <Core.Iventure> iventures = FacadeDao.GetIventure(idCliente, idProveedor, idVendedor); grilla.DataSource = iventures; grilla.DataBind(); grilla.Visible = true; if (((List <Core.Iventure>)grilla.DataSource).Count == 0) { grilla.Visible = false; lblAviso.Visible = true; lblAviso.Text = "No se encontraron solicitudes disponibles para usted."; } else { grilla.Visible = true; lblAviso.Visible = false; } } catch { //Logger.EscribirEventLog(ex); lblAviso.Text = "Ocurrió un error al ejecutar la consulta, pongase en contacto con el administrador"; lblAviso.Visible = true; } }
private void CargarIventure() { if (Request.QueryString["IdIventure"] != null) { int idIventure = Convert.ToInt32(Request.QueryString["IdIventure"]); Core.Iventure iventure = FacadeDao.GetIventure(idIventure); if (iventure != null) { txtIdIventure.Text = iventure.Id.ToString(); //txtIdIventure.Enabled = false; txtProveedor.Text = iventure.Proveedor.RazonSocial; txtVencimiento.Text = ((iventure.Vencimiento.HasValue) ? iventure.Vencimiento.Value.ToShortDateString() : ""); txtDetalle.Text = iventure.DetalleAereo; cboAereo.SelectedIndex = cboAereo.Items.IndexOf(cboAereo.Items.FindByValue(iventure.TipoAereo)); txtImporteAereo.Text = iventure.ImporteAereo.ToString(); txtEstadia.Text = iventure.CiudadEstadia; txtPasajeros.Text = iventure.PasajerosEstadia.ToString(); txtImporteEstadia.Text = iventure.ImporteEstadia.ToString(); txtDetallesAuto.Text = iventure.DetalleAutomovil; txtImporteAuto.Text = iventure.ImporteAutomovil.ToString(); txtImporteTotal.Text = iventure.ImporteTotal.ToString(); txtNombre.Text = iventure.Cliente.Nombre; txtApellido.Text = iventure.Cliente.Apellido; txtCUITDNI.Text = iventure.Cliente.CuitDni; txtDomicilio.Text = iventure.Cliente.Domicilio; txtEmail.Text = iventure.Cliente.Email; txtTelefonos.Text = iventure.Cliente.Telefonos; txtImporteTotal.Enabled = false; txtIdIventure.Enabled = false; txtProveedor.Enabled = false; txtVencimiento.Enabled = false; txtDetalle.Enabled = false; cboAereo.Enabled = false; txtImporteAereo.Enabled = false; txtEstadia.Enabled = false; txtPasajeros.Enabled = false; txtImporteEstadia.Enabled = false; txtDetallesAuto.Enabled = false; txtImporteAuto.Enabled = false; txtNombre.Enabled = false; txtApellido.Enabled = false; txtCUITDNI.Enabled = false; txtDomicilio.Enabled = false; txtEmail.Enabled = false; txtTelefonos.Enabled = false; } } }
protected void Page_Load(object sender, EventArgs e) { int idIventure = Convert.ToInt32(Request["IdIventure"]); Core.Iventure iventure = FacadeDao.GetIventure(idIventure); if (!IsPostBack && Request["EncData"] != null && iventure != null) { string encData = ""; try { encData = Core.NpsEncripterHelper.Decrypt(Request["EncData"], iventure.Proveedor.ClaveEncNPS); encData = encData.Remove(encData.IndexOf("</TRANSACTIONS>") + "</TRANSACTIONS>".Length, encData.Length - (encData.IndexOf("</TRANSACTIONS>") + "</TRANSACTIONS>".Length)); ReprocesarPago(encData); } catch { Label2.Text = encData; } } Response.Redirect("MisIventures.aspx"); }
private void CargarIventure() { if (Request.QueryString["IdIventure"] != null) { int idIventure = Convert.ToInt32(Request.QueryString["IdIventure"]); Core.Iventure iventure = FacadeDao.GetIventure(idIventure); if (iventure != null) { txtIdIventure.Text = iventure.Id.ToString(); //txtIdIventure.Enabled = false; txtProveedor.Text = iventure.Proveedor.RazonSocial; txtVendedor.Text = iventure.Vendedor; txtDetalle.Text = iventure.DetalleAereo; txtImporte.Text = iventure.ImporteTotal.ToString("F2"); cboCntCuotas.SelectedIndex = cboCntCuotas.Items.IndexOf(cboCntCuotas.Items.FindByValue(iventure.CntCuotas.ToString())); txtNombre.Text = iventure.Cliente.Nombre; txtApellido.Text = iventure.Cliente.Apellido; txtCUITDNI.Text = iventure.Cliente.CuitDni; txtDomicilio.Text = iventure.Cliente.Domicilio; txtEmail.Text = iventure.Cliente.Email; txtTelefonos.Text = iventure.Cliente.Telefonos; txtImporte.Enabled = false; cboCntCuotas.Enabled = false; txtIdIventure.Enabled = false; txtProveedor.Enabled = false; txtVendedor.Enabled = false; txtDetalle.Enabled = false; txtNombre.Enabled = false; txtApellido.Enabled = false; txtCUITDNI.Enabled = false; txtDomicilio.Enabled = false; txtEmail.Enabled = false; txtTelefonos.Enabled = false; } } }
private void ProcesarPago() { if (Request["egp_data"] != null && Request.QueryString["IdIventure"] != null) { Core.Iventure iventure = FacadeDao.GetIventure(Convert.ToInt32(Request.QueryString["IdIventure"])); if (iventure != null) { //string data = Core.NpsEncripterHelper.Decrypt(Request["egp_data"], ConfigurationManager.AppSettings["Key"]); //string data = Core.NpsEncripterHelper.Decrypt(Request["egp_data"], iventure.Proveedor.ClaveEncNPS); string data = Core.NpsEncripterHelper.Decrypt(Request["egp_data"], "298887645747869742751484443145062435617099358761"); //"298887645747869742751484443145062435617099358761" string[] campos = data.Split("|".ToCharArray()); string codigo = "-11111"; string sOrderId = "-1"; string sAmount = "-1"; string sFecha = "", sHora = "", sTrans = "", sAuthorizCode = ""; DateTime fechaPago; for (int i = 0; i < campos.Length; i++) { if (campos[i].StartsWith("egp_ResponseCode=")) { codigo = campos[i].Substring("egp_ResponseCode=".Length); } else if (campos[i].StartsWith("egp_OrderID=")) { sOrderId = campos[i].Substring("egp_OrderID=".Length); } else if (campos[i].StartsWith("egp_Amount=")) { sAmount = campos[i].Substring("egp_Amount=".Length); } else if (campos[i].StartsWith("egp_FechaTrn_srv=")) { sFecha = campos[i].Substring("egp_FechaTrn_srv=".Length); } else if (campos[i].StartsWith("egp_HoraTrn_srv=")) { sHora = campos[i].Substring("egp_HoraTrn_srv=".Length); } else if (campos[i].StartsWith("egp_TrnID=")) { sTrans = campos[i].Substring("egp_TrnID=".Length); } else if (campos[i].StartsWith("egp_AuthorizCode=")) { sAuthorizCode = campos[i].Substring("egp_AuthorizCode=".Length); } } fechaPago = GetFechaPago(sFecha, sHora); string sufijo = ""; string detalle = iventure.DetalleAereo; if (iventure.DetalleAereo.Length > 30) { sufijo = " ..."; detalle = iventure.DetalleAereo.Substring(0, 30); } lblDescripcion.Text = detalle + sufijo; lblFecha.Text = fechaPago.ToShortDateString(); lblHora.Text = fechaPago.ToShortTimeString(); lblTrans.Text = sTrans; lblIdIventure.Text = sOrderId; lblCodAut.Text = sAuthorizCode; imgEmpresa.ImageUrl = iventure.Proveedor.UrlImagen; int orderId, authorizCode; Int64 trnID; double amount; System.Globalization.CultureInfo cultureEN_US = new System.Globalization.CultureInfo("en-US"); if (codigo == "-1") { amount = Convert.ToDouble(sAmount, cultureEN_US); lblImporte.Text = amount.ToString(new System.Globalization.CultureInfo("es-ar")); orderId = Convert.ToInt32(sOrderId); authorizCode = Convert.ToInt32(sAuthorizCode); trnID = Convert.ToInt64(sTrans); FacadeDao.ProcesarPago(orderId, amount, fechaPago, trnID, authorizCode); } } } else if (Request["egp_data"] == null) { lblData.Text = "No se encontraron valores en egp_data"; } else { //Request.QueryString["IdIventure"] != null lblData.Text = "No se encontraron valores en IdIventure"; } }
private void CargarIventure() { bool existIdIventure = false; string sIdIventure = null; if (Request.QueryString["IdCliente"] == null && Request.Path.Length < Request.RawUrl.Length) { string parameters = Request.RawUrl.Substring(Request.Path.Length + 1); string queryString = Cryptography.Desencriptar(parameters); string[] values = queryString.Split("=".ToCharArray()); for (int i = 0; i < values.Length; i++) { if (values[i].ToLower() == "idiventure") { existIdIventure = true; if (i + 1 < values.Length) { sIdIventure = values[i + 1]; } break; } } } if (existIdIventure) { int idIventure = Convert.ToInt32(sIdIventure); iventure = FacadeDao.GetIventure(idIventure); if (iventure != null) { txtIdIventure.Text = iventure.Id.ToString(); txtIdIventure.Enabled = false; txtProveedor.Text = iventure.Proveedor.RazonSocial; egp_MerchantID_NoPost.Value = "test_travelpay"; //iventure.Proveedor.IdGateway; EPAY_ShopCode_NoPost.Value = iventure.Proveedor.IdGateway; dev_NoPost.Value = "1"; //(iventure.Proveedor.DevNPS) ? "1" : "0"; /*txtVendedor.Text = iventure.Vendedor; * hdnIdVendedor.Value = iventure.IdVendedor.ToString();*/ cboVendedores.SelectedIndex = cboVendedores.Items.IndexOf(cboVendedores.Items.FindByValue(iventure.IdVendedor.ToString())); txtDetalle.Text = iventure.DetalleAereo; txtImporte.Text = iventure.ImporteTotal.ToString(); txtFechaHasta.Text = iventure.Vencimiento.HasValue ? iventure.Vencimiento.Value.ToString("dd/MM/yyyy") : ""; cboCntCuotas.SelectedIndex = cboCntCuotas.Items.IndexOf(cboCntCuotas.Items.FindByValue(iventure.CntCuotas.ToString())); hdnIdCliente.Value = iventure.Cliente.Id.ToString(); txtNombre.Text = iventure.Cliente.Nombre; txtApellido.Text = iventure.Cliente.Apellido; txtCUITDNI.Text = iventure.Cliente.CuitDni; txtDomicilio.Text = iventure.Cliente.Domicilio; txtEmail.Text = iventure.Cliente.Email; txtTelefonos.Text = iventure.Cliente.Telefonos; Session["Logo"] = iventure.Proveedor.UrlImagen; if (iventure.Proveedor.Gateway == "NPS - Sub1") { btnPagar.Attributes.Add("onclick", "SubmitNPS();"); } else if (iventure.Proveedor.Gateway == "ePayments") { btnPagar.Attributes.Add("onclick", "SubmitEPayments();"); } else if (iventure.Proveedor.Gateway == "PagoFacil") { btnPagar.Attributes.Add("onclick", "SubmitPagoFacil();"); } } else { btnPagar.Enabled = false; } } else { Proveedor prov = null; if (Session["Proveedor"] != null) { prov = (Proveedor)(Session["Proveedor"]); txtFechaHasta.Text = DateTime.Today.AddDays(prov.DiasVencimiento).ToString("dd/MM/yyyy"); } } }