protected void BtnCadastrar_Click(object sender, EventArgs e)
        {
            MODReuniaoParticipante reuniaoParticipante = new MODReuniaoParticipante();
            MODDocente             docente             = new MODDocente();

            foreach (RepeaterItem dli in RptDocente.Items)
            {
                if (dli.ItemType == ListItemType.Item || dli.ItemType == ListItemType.AlternatingItem)
                {
                    DropDownList ddl = (DropDownList)dli.FindControl("DdlAddParticipante");
                    if (ddl.Text == "Sim")
                    {
                        Label  lbl    = (Label)dli.FindControl("TxtNomeParticipante");
                        string titulo = lbl.Text;
                        docente.Nome = titulo;

                        docente = BLLDocente.PesquisarDocente(docente, "nome");

                        reuniaoParticipante.FkDocente = docente.IdDocente;
                        reuniaoParticipante.FKReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);

                        BLLReuniaoParticipante.Inserir(reuniaoParticipante);
                        LblResposta.Text = "Participante(s) cadastrado(s) com sucesso!";
                    }
                }
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                MODReuniao reuniao = new MODReuniao();
                reuniao.IdReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);
                reuniao           = BLLReuniao.PesquisarReuniao(reuniao, "id_reuniao");

                if (reuniao.HoraFim.ToString() == "01/01/0001 00:00:00")
                {
                    LblResposta.Text = "Não foi possivel exibir a ata da reunião, pois a mesma ainda não foi encerrada!";
                }
                else
                {
                    RptPauta.DataSource = BLLReuniao.Pesquisar(reuniao, "reuniao");
                    RptPauta.DataBind();

                    MODReuniaoParticipante reuniaoParticipante = new MODReuniaoParticipante();
                    reuniaoParticipante.FKReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);
                    RptParticipante.DataSource    = BLLReuniaoParticipante.PesquisarDocente(reuniaoParticipante, "reuniao");
                    RptParticipante.DataBind();

                    MODReuniaoConvidado reuniaoConvidado = new MODReuniaoConvidado();
                    reuniaoConvidado.FkReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);
                    RptConvidado.DataSource    = BLLReuniaoConvidado.Pesquisar(reuniaoConvidado, "reuniao");
                    RptConvidado.DataBind();

                    MODAta ata = new MODAta();
                    ata.FkReuniao          = Convert.ToInt32(Page.Request.QueryString["id"]);
                    RptConsulta.DataSource = BLLAta.Pesquisar(ata, "reuniao");
                    RptConsulta.DataBind();
                }
            }
        }
Beispiel #3
0
        public static void Excluir(MODReuniaoParticipante reuniaoParticipante)
        {
            Conexao.Abrir();

            MySqlCommand comando = new MySqlCommand();

            comando.Connection = Conexao.conexao;

            comando.CommandText = "DELETE FROM TBLREUNIAO_PARTICIPANTE WHERE fk_docente = @docente and fk_reuniao = @reuniao";
            comando.Parameters.AddWithValue("@docente", reuniaoParticipante.FkDocente);
            comando.Parameters.AddWithValue("@reuniao", reuniaoParticipante.FKReuniao);

            comando.ExecuteNonQuery();

            Conexao.Fechar();
        }
Beispiel #4
0
        public static void Inserir(MODReuniaoParticipante reuniaoParticipante)
        {
            Conexao.Abrir();

            MySqlCommand comando = new MySqlCommand();

            comando.Connection = Conexao.conexao;

            comando.CommandText = "INSERT INTO tblreuniao_participante (fk_docente, fk_reuniao) "
                                  + "VALUES (@fk_docente, @fk_reuniao)";
            comando.Parameters.AddWithValue("@fk_docente", reuniaoParticipante.FkDocente);
            comando.Parameters.AddWithValue("@fk_reuniao", reuniaoParticipante.FKReuniao);

            comando.ExecuteNonQuery();

            Conexao.Fechar();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            MODReuniao reuniao = new MODReuniao();

            if (!Page.IsPostBack)
            {
                reuniao.IdReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);
                reuniao           = BLLReuniao.PesquisarReuniao(reuniao, "id_reuniao");
                TxtPauta.Text     = reuniao.Pauta;

                MODReuniaoParticipante reuniaoParticipante = new MODReuniaoParticipante();
                reuniaoParticipante.FKReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);

                List <MODDocente> docente = new List <MODDocente>();

                docente = BLLReuniaoParticipante.PesquisarDocente(reuniaoParticipante, "reuniao");

                if (docente.Count != 0)
                {
                    if (reuniao.HoraFim.ToString() == "01/01/0001 00:00:00")
                    {
                        RptExcluir.DataSource = docente;
                        RptExcluir.DataBind();

                        docente = BLLReuniaoParticipante.PesquisarDocente(reuniaoParticipante, "existente");
                        RptDocente.DataSource = docente;
                        RptDocente.DataBind();
                    }
                }
                else
                {
                    MODGrupoDocente grupoDocente = new MODGrupoDocente();
                    grupoDocente.FkGrupo  = reuniao.FkGrupo;
                    RptDocente.DataSource = BLLGrupo_Docente.Pesquisar(grupoDocente, "grupo");
                    RptDocente.DataBind();
                }

                if (reuniao.HoraFim.ToString() != "01/01/0001 00:00:00")
                {
                    LblResposta.Text     = "Não é possivel editar os participantes, pois a reunião já foi encerrada!";
                    BtnCadastrar.Visible = false;
                }
            }
        }
Beispiel #6
0
        public static List <MODDocente> PesquisarDocente(MODReuniaoParticipante item, string tipoPesquisa)
        {
            List <MODDocente> retorno = new List <MODDocente>();

            Conexao.Abrir();

            MySqlCommand comando = new MySqlCommand();

            comando.Connection = Conexao.conexao;

            if (tipoPesquisa == "reuniao")
            {
                comando.CommandText = "SELECT d.id_docente, d.nome from tbldocente d  "
                                      + "inner join tblreuniao_participante rd on rd.fk_docente = d.id_docente and rd.fk_reuniao = @reuniao";
            }
            else
            {
                comando.CommandText = "SELECT * FROM tbldocente d "
                                      + "inner join tblgrupo_docente gd "
                                      + "on gd.fk_docente = d.id_docente "
                                      + "WHERE d.id_docente NOT IN(SELECT fk_docente FROM tblreuniao_participante where fk_reuniao = @reuniao)";
            }


            comando.Parameters.AddWithValue("@reuniao", item.FKReuniao);

            MySqlDataReader reader = comando.ExecuteReader();

            while (reader.Read())
            {
                MODDocente ret = new MODDocente();
                ret.IdDocente = Convert.ToInt32(reader["id_docente"]);
                ret.Nome      = reader["Nome"].ToString();
                retorno.Add(ret);
            }

            reader.Close();

            Conexao.Fechar();

            return(retorno);
        }
        protected void BtnExcluir_Click(object sender, EventArgs e)
        {
            MODDocente             docente             = new MODDocente();
            MODReuniaoParticipante reuniaoParticipante = new MODReuniaoParticipante();

            Control      botao = (Control)sender;
            RepeaterItem item  = (RepeaterItem)botao.Parent;

            Label  lbl    = (Label)item.FindControl("TxtNomeParticipante");
            string titulo = lbl.Text;

            docente.Nome = titulo;

            docente = BLLDocente.PesquisarDocente(docente, "nome");
            reuniaoParticipante.FkDocente = docente.IdDocente;
            reuniaoParticipante.FKReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);

            string opcao = Request.Form["opcao"];

            if (opcao == "Sim")
            {
                BLLReuniaoParticipante.Excluir(reuniaoParticipante);
                Response.Write("<script>alert('Participante excluido com sucesso!')</script>");
            }

            reuniaoParticipante.FKReuniao = Convert.ToInt32(Page.Request.QueryString["id"]);

            List <MODDocente> docenteLista = new List <MODDocente>();

            docenteLista = BLLReuniaoParticipante.PesquisarDocente(reuniaoParticipante, "reuniao");

            RptExcluir.DataSource = docenteLista;
            RptExcluir.DataBind();

            docenteLista          = BLLReuniaoParticipante.PesquisarDocente(reuniaoParticipante, "existente");
            RptDocente.DataSource = docenteLista;
            RptDocente.DataBind();
        }
 public static List <MODDocente> PesquisarDocente(MODReuniaoParticipante item, string tipoPesquisa)
 {
     return(DALReuniaoParticipante.PesquisarDocente(item, tipoPesquisa));
 }
 public static void Excluir(MODReuniaoParticipante reuniaoParticipante)
 {
     DALReuniaoParticipante.Excluir(reuniaoParticipante);
 }
 public static void Inserir(MODReuniaoParticipante reuniaoParticipante)
 {
     DALReuniaoParticipante.Inserir(reuniaoParticipante);
 }