Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Session["user"] == null)
         {
             Response.Redirect("Login.aspx");
         }
         if (Request.Params["id"] != null)
         {
             String id = Request.Params["id"];
             getConn();
             Participante par = new ParticipanteDAO().findById(Convert.ToInt32(id));
             txtNome.Text          = par.Nome;
             txtEmail.Text         = par.Email;
             txtLinhaPesquisa.Text = par.Linhaspesquisa;
             txtCurriluim.Text     = par.BreveCurriculum;
             cbTec.SelectedValue   = par.Titulacao;
             cbTipo.SelectedValue  = par.Tipo.ToString();
             txtFoto.Value         = par.Foto;
             Image1.ImageUrl       = par.Foto;
             Seq.Value             = par.Sequencial.ToString();
             txtLattes.Text        = par.Lattes;
         }
     }
 }
Пример #2
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            String Sequencial = e.Values["Sequencial"].ToString();

            try {
                ParticipanteDAO dao = new ParticipanteDAO();
                dao.delete(Convert.ToInt32(Sequencial));
                refreshCima();
            } catch {
            }
        }
Пример #3
0
        public void refreshBaixo()
        {
            getConn();
            ParticipanteDAO dao = new ParticipanteDAO();

            IList <Participante> alunos = dao.findByParameters(new Participante()
            {
                Tipo = 2
            });

            GridView2.DataSource = alunos;
            GridView2.DataBind();
        }
Пример #4
0
        public void refreshCima()
        {
            getConn();
            ParticipanteDAO dao = new ParticipanteDAO();

            IList <Participante> pesquisadores = dao.findByParameters(new Participante()
            {
                Tipo = 1
            });

            GridView1.DataSource = pesquisadores;
            GridView1.DataBind();
        }
Пример #5
0
        protected void BtSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                Page.Validate();
                if (Page.IsValid)
                {
                    getConn();
                    Participante part = new Participante();


                    part.Nome            = txtNome.Text;
                    part.Email           = txtEmail.Text;
                    part.BreveCurriculum = txtCurriluim.Text;
                    part.Ativo           = true;
                    part.Foto            = txtFoto.Value;
                    part.Lattes          = txtLattes.Text;
                    part.Titulacao       = cbTec.SelectedValue;
                    part.Tipo            = Convert.ToInt32(cbTipo.SelectedValue);
                    part.Linhaspesquisa  = txtLinhaPesquisa.Text;
                    ParticipanteDAO dao = new ParticipanteDAO();
                    if (Seq.Value == "")
                    {
                        dao.create(part);
                    }
                    else
                    {
                        part.Sequencial = Convert.ToInt32(Seq.Value);
                        dao.update(part);
                    }

                    Server.Transfer("~/Sucesso.aspx");
                }
            }
            catch { }
        }