private void LlenarForm()
        {
            bdCon objconexion = new bdCon();

            objconexion.objSqlconn.Open();
            SqlCommand     cmd = new SqlCommand("select Nombre,Apellidos,Telefono from Empleados where Matricula='" + MatAct + "'", objconexion.objSqlconn);
            SqlDataAdapter sda = new SqlDataAdapter(cmd);
            DataTable      dt  = new DataTable();

            sda.Fill(dt);
            cmd.ExecuteNonQuery();
            if (dt.Rows.Count != 0)
            {
                txtNombre.Text    = dt.Rows[0][0].ToString();
                txtApellidos.Text = dt.Rows[0][1].ToString();
                txtTel.Text       = dt.Rows[0][2].ToString();
            }

            SqlCommand     cmd4 = new SqlCommand("select Contra from Usuarios where Matricula='" + MatAct + "'", objconexion.objSqlconn);
            SqlDataAdapter sda4 = new SqlDataAdapter(cmd4);
            DataTable      dt4  = new DataTable();

            sda4.Fill(dt4);
            cmd4.ExecuteNonQuery();
            if (dt.Rows.Count != 0)
            {
                txtContra.Text = dt4.Rows[0][0].ToString();

                txtMatricula.Text = MatAct;
            }



            DataTable dtAreas = new DataTable();

            dtAreas                = objconexion.GetDataTable("EXEC llamarAreas");
            DDLArea.DataSource     = dtAreas;
            DDLArea.DataValueField = "idArea";
            DDLArea.DataTextField  = "Area";
            DDLArea.DataBind();

            DataTable puestos = new DataTable();

            puestos = objconexion.GetDataTable("EXEC llamarPuestos");
            DDLPuesto.DataSource     = puestos;
            DDLPuesto.DataValueField = "idPuesto";
            DDLPuesto.DataTextField  = "puesto";
            DDLPuesto.DataBind();

            objconexion.objSqlconn.Close();
        }
Beispiel #2
0
        private void LlenarForm()
        {
            bdCon objconexion = new bdCon();

            DataTable dtAreas = new DataTable();

            dtAreas                = objconexion.GetDataTable("EXEC llamarAreas");
            DDLArea.DataSource     = dtAreas;
            DDLArea.DataValueField = "idArea";
            DDLArea.DataTextField  = "Area";
            DDLArea.DataBind();



            DataTable puestos = new DataTable();

            puestos = objconexion.GetDataTable("EXEC llamarPuestos");
            DDLPuesto.DataSource     = puestos;
            DDLPuesto.DataValueField = "idPuesto";
            DDLPuesto.DataTextField  = "puesto";
            DDLPuesto.DataBind();
        }