예제 #1
0
    private void CargarProveedor()
    {
        Proveedor prov = FacadeDao.GetProveedor(Request.QueryString["IdGateway"]);

        Session["Proveedor"] = prov;

        txtProveedor.Text           = prov.RazonSocial;
        txtProveedor.Enabled        = false;
        egp_MerchantID_NoPost.Value = prov.IdGateway;
        EPAY_ShopCode_NoPost.Value  = prov.IdGateway;
        dev_NoPost.Value            = (prov.DevNPS) ? "1" : "0";
        Session["scriptPago"]       = "";

        if (prov.Gateway == "NPS - Sub1")
        {
            Session["scriptPago"] = "SubmitNPS();";
        }
        else if (prov.Gateway == "ePayments")
        {
            Session["scriptPago"] = "SubmitEPayments();";
        }
        else if (prov.Gateway == "PagoFacil")
        {
            Session["scriptPago"] = "SubmitPagoFacil();";
        }
    }
예제 #2
0
 protected void btnLogin_Click(object sender, ImageClickEventArgs e)
 {
     if (txtPassword.Text.Trim() != "" && txtUsuario.Text.Trim() != "")
     {
         Usuario usu = FacadeDao.GetUsuario(txtUsuario.Text, txtPassword.Text);
         if (usu != null)
         {
             Session["Usuario"] = usu;
             GetMenu(usu);
             if (usu.IsProveedor)
             {
                 Session["Proveedor"] = FacadeDao.GetProveedor(usu.IdProveedor.Value);
             }
             else if (usu.IsCliente)
             {
                 Session["Cliente"] = FacadeDao.GetCliente(usu.IdCliente.Value);
             }
             SetLogo();
             Response.Redirect(redirect);
         }
         else
         {
             string script = "alert('Usuario o password equivocado');";
             Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToFileTime().ToString(), script);
         }
     }
     else
     {
         string script = "alert('Complete el usuario y password');";
         Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToFileTime().ToString(), script);
     }
 }
예제 #3
0
 private void CargarProveedor()
 {
     if (Request.QueryString["IdProveedor"] != null)
     {
         int idProveedor = Convert.ToInt32(Request.QueryString["IdProveedor"]);
         proveedor = FacadeDao.GetProveedor(idProveedor);
         if (proveedor != null)
         {
             txtIdProveedor.Value        = proveedor.Id.ToString();
             txtEmail.Text               = proveedor.Email;
             txtCuit.Text                = proveedor.CUIT;
             txtIIBB.Text                = proveedor.IIBB;
             txtRazonsocial.Text         = proveedor.RazonSocial;
             txtFechaAlta.Text           = proveedor.Alta.ToShortDateString();
             cboGateway.SelectedIndex    = cboGateway.Items.IndexOf(cboGateway.Items.FindByValue(proveedor.Gateway));
             txtIdGateway.Text           = proveedor.IdGateway.ToString();
             txtNombreResponsable.Text   = proveedor.NombreResp;
             txtApellidoResponsable.Text = proveedor.ApellidoResp;
             txtDNIResponsable.Text      = proveedor.DNIResp;
             txtCargoResponsable.Text    = proveedor.CargoResp;
             txtCntTransacciones.Text    = proveedor.CntTransacciones.ToString();
             txtMontoTransacciones.Text  = proveedor.MontoTransacciones.ToString("F2");
             txtImagen.Text              = proveedor.UrlImagen;
             txtTelefonos.Text           = proveedor.Telefonos;
             txtClaveEncNPS.Text         = proveedor.ClaveEncNPS;
             cboDevNPS.SelectedIndex     = cboDevNPS.Items.IndexOf(cboDevNPS.Items.FindByValue(proveedor.DevNPS.ToString()));
             txtDiasVencimiento.Text     = proveedor.DiasVencimiento.ToString();
             chkAmerican.Checked         = proveedor.TieneAmericanExpress;
             chkCabal.Checked            = proveedor.TieneCabal;
             chkDiners.Checked           = proveedor.TieneDiners;
             chkMastercard.Checked       = proveedor.TieneMastercard;
             chkNaranja.Checked          = proveedor.TieneNaranja;
             chkNevada.Checked           = proveedor.TieneNevada;
             chkVisa.Checked             = proveedor.TieneVisa;
         }
     }
     else
     {
         txtFechaAlta.Text = DateTime.Today.ToShortDateString();
     }
 }
예제 #4
0
 private void ProcesarConfirmacion()
 {
     if (Request.QueryString["egp_data"] != null && Request.QueryString["MerchantId"] != null)
     {
         //string data = Core.NpsEncripterHelper.Decrypt(Request.QueryString["egp_data"], ConfigurationManager.AppSettings["Key"]);
         Proveedor prov = null;
         prov = FacadeDao.GetProveedor(Request.QueryString["MerchantId"]);
         if (prov != null)
         {
             string   data     = Core.NpsEncripterHelper.Decrypt(Request.QueryString["egp_data"], prov.ClaveEncNPS);
             string[] campos   = data.Split("|".ToCharArray());
             string   codigo   = "-11111";
             string   sOrderId = "-1";
             string   sAmount  = "-1";
             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);
                 }
             }
             string descripcion = CodigosNPS.GetDescripcion(Convert.ToInt32(codigo));
             int    orderId;
             double amount;
             System.Globalization.CultureInfo cultureEN_US = new System.Globalization.CultureInfo("en-US");
             if (codigo == "-1")
             {
                 amount  = Convert.ToDouble(sAmount, cultureEN_US);
                 orderId = Convert.ToInt32(sOrderId);
                 if (FacadeDao.IventurePagado(orderId))
                 {
                     Response.Clear();
                     Response.Write("-1");
                 }
                 else
                 {
                     FacadeDao.ProcesarPago(orderId, amount);
                     Response.Clear();
                     Response.Write("1");
                 }
             }
         }
         else
         {
             throw new Exception("No se encontró un proveedor con merchantId = " + Request.QueryString["idGateway"]);
         }
     }
     else if (Request.QueryString["egp_data"] == null)
     {
         throw new Exception("No se encontró el parámetro egp_data");
     }
     else
     {               //Request.QueryString["MerchantId"] == null
         throw new Exception("No se encontró el parámetro idGateway");
     }
 }