예제 #1
0
 private void btnProfessor_Click(object sender, EventArgs e)
 {
     Minhas_Classes.Professor prof = new Minhas_Classes.Professor();
     cmbProfessor.DataSource    = prof.Buscar().Tables[0];
     cmbProfessor.ValueMember   = "idprofessor";
     cmbProfessor.DisplayMember = "nome";
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         gridProfessor.DataSource = prof.Buscar();
         gridProfessor.DataBind();
         rbListSexo.SelectedIndex = 0;
     }
     if (rbListSexo.AutoPostBack)
     {
         gridProfessor.DataSource = prof.BuscarPorSexo(rbListSexo.SelectedValue);
         gridProfessor.DataBind();
     }
     if (chkListIdade.AutoPostBack)
     {
         if (Convert.ToString(chkListIdade.SelectedItem) != "")
         {
             //Response.Write("<script>alert('Professor " + chkListIdade.SelectedItem + " selecionado.');</script>");
             gridProfessor.DataSource = prof.BuscarPorIdade(Convert.ToString(chkListIdade.SelectedItem));
             gridProfessor.DataBind();
         }
         else
         {
             gridProfessor.DataSource = prof.BuscarPorSexo(rbListSexo.SelectedValue);
             gridProfessor.DataBind();
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Minhas_Classes.Professor prof = new Minhas_Classes.Professor();
         drtProfessor.DataSource     = prof.Buscar();
         drtProfessor.DataTextField  = "nome";
         drtProfessor.DataValueField = "idProfessor";
         drtProfessor.DataBind();
         drtProfessor.SelectedIndex = 2;
     }
 }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     gridProfessor.DataSource = prof.Buscar();
     gridProfessor.DataBind();
 }
예제 #5
0
 private void btnCarregaDados_Click(object sender, EventArgs e)
 {
     gridProfessor.DataSource   = prof.Buscar().Tables[0];
     gridFuncionario.DataSource = prof.Buscar().Tables[1];
 }