コード例 #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
            {
                Panel_ModificarCliente.Visible = true;
                this.Doc = grid01.CurrentRow.Cells[0].Value.ToString();
                DataTable tabla = new DataTable();
                tabla = Empleados.RecuperarEmpleados(Doc);

                EsNull = tabla.Rows[0]["numDocJefe"].ToString();

                txt_TipoDoc.Text         = tabla.Rows[0]["tipoDoc"].ToString();
                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();
                cmb_barrio.SelectedValue = int.Parse(tabla.Rows[0]["codBarrio"].ToString());
                txt_Telefono.Text        = tabla.Rows[0]["telefono"].ToString();
                cmb_activo.SelectedItem  = tabla.Rows[0]["activo"].ToString();

                if (EsNull == "")
                {
                    cmb_TipoDocJefe.Cargar(TipoDoc.EstructuraCombo());
                    cmb_TipoDocJefe.SelectedValue = -1;
                    txt_NumDocJefe.Text           = "";
                    cmb_TipoDocJefe.Enabled       = false;
                    txt_NumDocJefe.Enabled        = false;
                }
                else
                {
                    cmb_TipoDocJefe.Cargar(TipoDoc.EstructuraCombo());
                    txt_NumDocJefe.Text     = tabla.Rows[0]["numDocJefe"].ToString();
                    cmb_TipoDocJefe.Enabled = true;
                    txt_NumDocJefe.Enabled  = true;
                }
            }
        }