protected void EnviarSMSText(object sender, EventArgs e)
        {
            try
            {
                Empresa emp = new Empresa();
                Validar.validarselected(estadofactura.SelectedValue);

                foreach (DataRow item in tablefactura.Rows)
                {
                    if (item["estadof"].ToString() == estadofactura.SelectedValue)
                    {
                        string msm = Descripcion(emp.ConsultarEmpresa(), estadofactura.SelectedValue);
                        telefon.terceros_idterceros = item["identificacion"].ToString();
                        DataRow datf = telefon.ConsultarTelefonosIdTerceros(telefon).Rows[0];
                        if (datf["telefono"].ToString().Length >= 10)
                        {
                            string celular = "57" + datf["telefono"].ToString(); //datf["telefono"].ToString();
                            string nombre  = item["nombre"].ToString() + " " + item["apellido"].ToString();
                            ClientScript.RegisterStartupScript(GetType(), "msm", "EnviarSMS('" + msm + "','" + celular + "');", true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                textError.InnerHtml = ex.Message;
                Alerta.CssClass     = "alert alert-error";
                Alerta.Visible      = true;
            }
        }
Ejemplo 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;
            }
        }
        public void cargarActualizar(string ent)
        {
            ClientScript.RegisterStartupScript(GetType(), "alerta", "panel2();", true);
            try
            {
                terc.identificacion = ent;
                DataRow dat = terc.ConsultarPersonaIdentifall(terc).Rows[0];
                identificacion_.Value       = dat["identificacion"].ToString();
                nombre_.Value               = dat["nombre"].ToString();
                apellido_.Value             = dat["apellido"].ToString();
                Direccion_.Value            = dat["direccion"].ToString();
                correo_.Value               = dat["correo"].ToString();
                estrato_.SelectedValue      = dat["estrato"].ToString();
                estado_.SelectedValue       = dat["estado"].ToString();
                tipodoc_.SelectedValue      = dat["tipodoc_idtipodoc"].ToString();
                tiporesident_.SelectedValue = dat["tiporesidencia_idtiporesidencia"].ToString();
                tipofact_.SelectedValue     = dat["tipofactura_idtipofactura"].ToString();
                barrio_.SelectedValue       = dat["barrio_idbarrio"].ToString();
                rh_.SelectedValue           = dat["rh"].ToString();
                if (dat["fechexp"] != null && dat["fechexp"].ToString() != "")
                {
                    fecnac_.Value = Convert.ToDateTime(dat["fechexp"]).ToString("yyyy-MM-dd");
                }
                tlf.terceros_idterceros = dat["identificacion"].ToString();
                listtelefono            = tlf.ConsultarTelefonosIdTerceros(tlf);

                ct.identificacion = dat["identificacion"].ToString();
                tabletipo         = ct.ConsultarCargoIdentifi(ct);

                activacion = true;

                viewedicion.Visible    = true;
                textediccion.InnerHtml = "Edicción habilitada para " + dat["nombre"].ToString() + " " + dat["apellido"].ToString();
                codigo.InnerHtml       = dat["idterceros"].ToString();

                barr.idbarrios = dat["barrio_idbarrio"].ToString();
                DataRow dir = barr.ConsultarTodoporBarrio(barr).Rows[0];
                cargarDepartamentos(dir["idpais"].ToString());
                pais_.SelectedValue         = dir["idpais"].ToString();
                departamento_.SelectedValue = dir["iddepartamento"].ToString();
                cargarMunicipios(dir["iddepartamento"].ToString());
                municipio_.SelectedValue = dir["idmunicipio"].ToString();
                cargarBarrios(dir["idmunicipio"].ToString());
            }
            catch (Exception ex)
            {
                textError.InnerHtml = ex.Message;
                Alerta.CssClass     = "alert alert-error";
                Alerta.Visible      = true;
            }
        }