Exemplo n.º 1
0
        private void btn_Modificar_Click(object sender, EventArgs e)
        {
            if (this.grid01.Rows.Count == 0)
            {
                MessageBox.Show("No selecciono ningun registro de la grilla", "Importante", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            else
            {
                this.cuit = grid01.CurrentRow.Cells[0].Value.ToString();
                DataTable Verificacion = new DataTable();
                Verificacion = Barrios.Buscar_Barrio_Codigo(this.cuit);
                if (Verificacion.Rows.Count > 0)
                {
                    Panel_ModificarCliente.Visible = true;

                    DataTable tabla = new DataTable();
                    tabla = Barrios.RecuperarBarrio_Codigo(cuit);
                    txt_codBarrio.Text   = tabla.Rows[0]["codBarrio"].ToString();
                    txt_NombreNuevo.Text = tabla.Rows[0]["nombre"].ToString();
                    string    codBarrio = tabla.Rows[0]["codLocalidad"].ToString();
                    DataTable tabla2    = new DataTable();
                    tabla2             = localidad.Buscar_Localidad_Codigo(codBarrio);
                    txt_Localidad.Text = tabla2.Rows[0]["nombre"].ToString();
                }
            }
        }
Exemplo n.º 2
0
        public void Cargar()
        {
            Ng_Empleados Empleado    = new Ng_Empleados();
            Ng_Barrios   Barrio      = new Ng_Barrios();
            DataTable    tablaBarrio = new DataTable();
            DataTable    tabla       = new DataTable();

            tabla       = Empleado.Buscar_Empleados_Usuario(usuario);
            tablaBarrio = Barrio.Buscar_Barrio_Codigo(tabla.Rows[0]["codBarrio"].ToString());

            for (int i = 0; i < tabla.Rows.Count; i++)
            {
                string tDoc = tabla.Rows[0]["tipoDoc"].ToString();
                if (tDoc == "1")
                {
                    txt_tipodoc.Text = "DNI";
                }
                txt_numdoc.Text    = tabla.Rows[0]["numDoc"].ToString();
                txt_nombre.Text    = tabla.Rows[0]["nombre"].ToString();
                txt_apellido.Text  = tabla.Rows[0]["apellido"].ToString();
                txt_direccion.Text = tabla.Rows[0]["direccion"].ToString();
                txt_barrio.Text    = tablaBarrio.Rows[0]["nombre"].ToString();
                txt_telefono.Text  = tabla.Rows[0]["telefono"].ToString();
                string jefe = tabla.Rows[0]["numDocJefe"].ToString();

                if (jefe == "")
                {
                    textRango.Text = "Jefe";
                }
                else
                {
                    textRango.Text = "Subordinado";
                }

                if (textRango.Text == "Subordinado")
                {
                    groupJefe.Visible = true;
                    DataTable tabla2 = new DataTable();
                    tabla2 = Empleado.Buscar_Empleados(tabla.Rows[0]["numDocJefe"].ToString());
                    txt_NumDocJefe.Text   = tabla.Rows[0]["numDocJefe"].ToString();
                    txt_nombreJefe.Text   = tabla2.Rows[0]["nombre"].ToString();
                    txt_apellidoJefe.Text = tabla2.Rows[0]["apellido"].ToString();
                }
            }
        }
Exemplo n.º 3
0
 private void btn_Buscar_Click(object sender, EventArgs e)
 {
     if (chk_Todos.Checked == true)
     {
         Cargar_grilla(Barrio.Todos_los_Barrios());
     }
     else
     {
         if (txt_BuscarCodigo.Text == "")
         {
             MessageBox.Show("No se ingreso parametro de busqueda");
         }
         else
         {
             Cargar_grilla(Barrio.Buscar_Barrio_Codigo(txt_BuscarCodigo.Text));
         }
     }
 }
Exemplo n.º 4
0
        private void btn_aceptar_Click(object sender, EventArgs e)
        {
            TratamientosEspeciales tratamiento = new TratamientosEspeciales();
            Es_Barrio _Ec          = new Es_Barrio();
            DataTable Verificacion = new DataTable();

            if (tratamiento.validar(this.Controls) == TratamientosEspeciales.Validacion.correcta)
            {
                _Ec.codBarrio    = txt_codBarrio.Text;
                _Ec.nombre       = txt_nombreCliente.Text;
                _Ec.codLocalidad = cmb_Localidad.SelectedValue.ToString();
                Verificacion     = Barrios.Buscar_Barrio_Codigo(_Ec.codBarrio);
                if (Verificacion.Rows.Count > 0)
                {
                    MessageBox.Show("El barrio que desea insertar ya existe. ", "ATENCION");
                }
                else
                {
                    Barrios.Insertar(_Ec);
                    this.Close();
                }
            }
        }