protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string url = Request.Url.Segments[Request.Url.Segments.Length - 1];//Obtiene GestioanrCooperativa.aspx
         if (per.ValidarPermisos(url, (DataTable)Session["roles"]))
         {
             if (!IsPostBack)
             {
                 string valor = Request.QueryString["key"];
                 contrato.terceros_idterceros = valor;
                 consultacontrato.DataSource  = Validar.Consulta(contrato.ConsultarContratoIdTercero(contrato));
                 consultacontrato.DataBind();
             }
         }
         else
         {
             Response.Redirect("Error.aspx?error=Acceso denegado: No tiene permisos");
         }
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }
Esempio n. 2
0
        private void consultardatoscliente(string identificacion)
        {
            tercero.identificacion = Validar.validarlleno(identificacion);
            DataRow row = Validar.Consulta(tercero.ConsultarTerceroAvanzado(tercero)).Rows[0];

            _tipocliente.Value    = row["tipoterceros"].ToString();
            identificacion_.Value = row["identificacion"].ToString();
            ident                   = row["identificacion"].ToString();
            _nombre_.Value          = row["nombre"].ToString() + " " + row["apellido"].ToString();
            _correo_.Value          = row["correo"].ToString();
            _estado_.Value          = row["estado"].ToString();
            _direccion_.Value       = row["direccion"].ToString();
            tlf.terceros_idterceros = row["identificacion"].ToString();
            DataTable listtelefono = tlf.ConsultarTelefonosIdTerceros(tlf);
            string    telef        = "";

            foreach (DataRow item in listtelefono.Rows)
            {
                telef += item["telefono"].ToString() + " ";
            }
            _telefono_.Value             = telef;
            contrato.terceros_idterceros = row["idterceros"].ToString();
            DataTable contclientes = contrato.ConsultarContratoIdTercero(contrato);

            consultacontrato.DataSource = contclientes;
            consultacontrato.DataBind();
            Alerta.Visible = false;
            datos.Visible  = true;
        }
        protected void consultacliente_SelectedIndexChanged(object sender, EventArgs e)
        {
            //AQUI SE SELECCIONA LA PERSONA
            try
            {
                GridViewRow gridw = consultacliente.SelectedRow;
                tercero.identificacion = Validar.validarlleno(gridw.Cells[0].Text);
                DataRow row = Validar.Consulta(tercero.ConsultarTerceroAvanzado(tercero)).Rows[0];
                _tipocliente.Value = row["tipoterceros"].ToString();

                identificacion_.Value = row["identificacion"].ToString();
                num.InnerHtml         = row["idterceros"].ToString();
                ident                   = row["identificacion"].ToString();
                _nombre_.Value          = row["nombre"].ToString() + " " + row["apellido"].ToString();
                _correo_.Value          = row["correo"].ToString();
                _estado_.Value          = row["estado"].ToString();
                _direccion_.Value       = row["direccion"].ToString();
                tlf.terceros_idterceros = row["identificacion"].ToString();
                DataTable listtelefono = tlf.ConsultarTelefonosIdTerceros(tlf);
                string    telef        = "";
                foreach (DataRow item in listtelefono.Rows)
                {
                    telef += item["telefono"].ToString() + " ";
                }
                _telefono_.Value             = telef;
                contrato.terceros_idterceros = row["idterceros"].ToString();
                contcliente = Validar.Consulta(contrato.ConsultarContratoIdTercero(contrato));
                consultacontrato.DataSource = contcliente;
                consultacontrato.DataBind();
                GridViewpagos.DataSource = null;
                GridViewpagos.DataBind();
                cargosadicionales.DataSource = null;
                cargosadicionales.DataBind();
                GridView1.DataSource = null;
                GridView1.DataBind();
                GridView2.DataSource = null;
                GridView2.DataBind();
                GridViewcuenta.DataSource = null;
                GridViewcuenta.DataBind();
                paneldedatosterceros.Visible = true;
                Alerta.Visible         = false;
                listordenes.DataSource = null;
                listordenes.DataBind();
                listsolicitudes.DataSource = null;
                listsolicitudes.DataBind();
            }
            catch (Exception ex)
            {
                textError.InnerHtml = ex.Message;
                Alerta.CssClass     = "alert alert-error";
                Alerta.Visible      = true;
            }
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                terc.identificacion = TextBoxdni.Text;
                DataRow te = Validar.Consulta(terc.ConsultarTerceroDos(terc)).Rows[0];
                contr.terceros_idterceros = te["idterceros"].ToString();
                DataRow cont = Validar.Consulta(contr.ConsultarContratoIdTercero(contr)).Rows[0];

                DataTable dat = Validar.Consulta(serv.consultaservicioscont1(cont["idcontrato"].ToString()));


                GridView1.DataSource = dat;
                GridView1.DataBind();
                divtablagestcontr.Visible = true;

                Label1.Text = te["nombre"].ToString();

                if (te["apellido"].ToString() == "")
                {
                    Label2.Visible = false;
                }
                else
                {
                    Label2.Text = te["apellido"].ToString();
                }
                TextBox1.Text           = te["direccion"].ToString();
                iddatosterceros.Visible = true;
                try
                {
                    DropDownList3.DataSource     = cinci.Consultarcategoriaincidencia();
                    DropDownList3.DataTextField  = "categoriaincidencia";
                    DropDownList3.DataValueField = "idcategoriaincidencia";
                    DropDownList3.DataBind();
                }
                catch (Exception ex)
                {
                    textError.InnerHtml = ex.Message;
                    Alerta.CssClass     = "alert alert-error";
                    Alerta.Visible      = true;
                }
            }
            catch (Exception ex)
            {
                textError.InnerHtml = ex.Message;
                Alerta.CssClass     = "alert alert-error";
                Alerta.Visible      = true;
            }
        }
Esempio n. 5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     //for (int i = 0; i < 10000; i++)
     //{
     //    contrat.insertpruebaconexion();
     //}
     try
     {
         terc.identificacion = texboxdni.Text;
         DataRow dat = Validar.Consulta(terc.ConsultarTerceroDos(terc)).Rows[0];
         contrat.terceros_idterceros = dat["idterceros"].ToString();
         DataTable datcont = Validar.Consulta(contrat.ConsultarContratoIdTercero(contrat));
         GridView1.DataSource = datcont;
         GridView1.DataBind();
         divtablagestcontr.Visible = true;
         cargarplanes();
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, this.GetType(), "hwa", "nocontro();", true);
     }
 }