Ejemplo n.º 1
0
 public void cadastroVagas(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string       inserir  = "INSERT INTO VAGAS(curso, escola, periodo, vagas, vestibulinho)VALUES('" + vg.Curso + "','" + vg.Escola + "','" + vg.Periodo + "','" + vg.Vaga + "','" + vg.Vestibulinho + "')";
         MySqlCommand comandos = new MySqlCommand(inserir, conexao);
         comandos.ExecuteNonQuery();
         conexao.Close();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public void Listao(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string       alterar  = "UPDATE geral SET listao='" + vg.Curso + "', perListao='" + vg.Periodo + "', matriculado='" + vg.Matriculado + "', chamada='" + vg.Chamada + "' WHERE cod = '" + vg.Codigo + "'";
         MySqlCommand comandos = new MySqlCommand(alterar, conexao);
         comandos.ExecuteNonQuery();
         conexao.Close();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 3
0
 public void ocultarVestibulinho(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string       alterar  = "UPDATE geral SET ocultar='" + vg.Ocultar + "'WHERE vestibulinho= '" + vg.Vestibulinho + "'";
         MySqlCommand comandos = new MySqlCommand(alterar, conexao);
         comandos.ExecuteNonQuery();
         conexao.Close();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 4
0
 public void atualizarChamadas(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string       alterar  = "UPDATE datas SET dtInicial='" + Convert.ToDateTime(vg.DtInicio).ToString("yyyy-MM-dd") + "', dtFinal= '" + Convert.ToDateTime(vg.DtFim).ToString("yyyy-MM-dd") + "'WHERE cod= '" + vg.Codigo + "'";
         MySqlCommand comandos = new MySqlCommand(alterar, conexao);
         comandos.ExecuteNonQuery();
         conexao.Close();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 5
0
 public void atualizarVagas(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string       alterar  = "UPDATE vagas SET vagas= '" + vg.Vaga + "'WHERE cod= '" + vg.Codigo + "'";
         MySqlCommand comandos = new MySqlCommand(alterar, conexao);
         comandos.ExecuteNonQuery();
         conexao.Close();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 6
0
 public void cadastroDatas(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string       inserir  = "INSERT INTO DATAS(chamada, dtInicial, dtFinal, vestibulinho)VALUES('" + vg.Chamada + "','" + Convert.ToDateTime(vg.DtInicio).ToString("yyyy-MM-dd") + "','" + Convert.ToDateTime(vg.DtFim).ToString("yyyy-MM-dd") + "','" + vg.Vestibulinho + "')";
         MySqlCommand comandos = new MySqlCommand(inserir, conexao);
         comandos.ExecuteNonQuery();
         conexao.Close();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable TotalFeminino(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT SUM(total) AS vagas FROM (SELECT COUNT(sexo) AS total FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "' AND habilitacao= '" + vg.Curso + "' AND periodo='" + vg.Periodo + "'AND escola='" + vg.Escola + "'AND matriculado='Sim' AND sexo='FEMININO' AND (chamada= '1ª Chamada' OR chamada='2ª Chamada' OR chamada='Pós chamadas') UNION SELECT COUNT(sexo) AS total FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "' AND listao='" + vg.Curso + "' AND perListao='" + vg.Periodo + "' AND matriculado='Sim' AND chamada='Listão' AND sexo='FEMININO' UNION SELECT COUNT(sexo) AS total FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "' AND habilitacao2='" + vg.Curso + "' AND chamada='2ª Opção' AND sexo='FEMININO') geral";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable NaoMatriculados(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT clas, nota, nome, endereco, telefone, celular, habilitacao FROM geral WHERE vestibulinho='" + vg.Vestibulinho + "' AND (matriculado IS NULL OR matriculado='Não') AND ausente IS NULL AND ausSegOP IS NULL ORDER BY habilitacao, nome";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable Pesquisa(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT clas, nota, nome, dtNasc, endereco, telefone, celular, habilitacao, escol, matriculado, chamada FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "'AND habilitacao='" + vg.Curso + "'AND periodo='" + vg.Periodo + "'AND escola='" + vg.Escola + "'ORDER BY CAST(clas as unsigned integer)";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable ListaoPorNome(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT cod, clas, nota, nome, dtNasc, endereco, telefone, celular, habilitacao, escol, matriculado, chamada FROM geral WHERE nome LIKE '%" + vg.Nome + "%' AND vestibulinho= '" + vg.Vestibulinho + "'ORDER BY nome";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable ContaMatricula(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT COUNT(matriculado) FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "' AND habilitacao= '" + vg.Curso + "'AND periodo='" + vg.Periodo + "'";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable DemaisOpcao(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT cod, clas, nota, nome, dtNasc, endereco, telefone, celular, email, habilitacao, escol, matriculado, ausente FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "'AND habilitacao= '" + vg.Curso + "'AND periodo='" + vg.Periodo + "'AND escola= '" + vg.Escola + "'AND(chamada!= '2ª Opção' or chamada is null) AND CAST(clas as unsigned integer) BETWEEN '" + vg.Ultimo + "' AND '" + vg.Sobra + "'ORDER BY CAST(clas as unsigned integer)";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable datasChamadas(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT cod, chamada, dtFinal, vestibulinho FROM datas WHERE vestibulinho='" + vg.Vestibulinho + "'";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 14
0
 public DataTable CursoCad(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT DISTINCT habilitacao, periodo, escola,(SELECT DISTINCT escola) FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "'order by habilitacao";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 15
0
 public DataTable comboListao(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT cod, chamada, escola, matriculado, habilitacao, periodo, habilitacao2, periodo2, listao, perListao FROM geral WHERE cod= '" + vg.Codigo + "'AND matriculado='sim'";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 16
0
 public DataTable SelecionaMatriculados(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT clas, nome, sexo FROM (SELECT clas, nome, sexo FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "' AND habilitacao= '" + vg.Curso + "' AND periodo='" + vg.Periodo + "'AND escola='" + vg.Escola + "'AND matriculado='Sim' AND (chamada= '1ª Chamada' OR chamada='2ª Chamada' OR chamada='Pós chamadas') UNION SELECT clas, nome, sexo FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "' AND listao='" + vg.Curso + "' AND perListao='" + vg.Periodo + "' AND matriculado='Sim' AND chamada='Listão'  UNION SELECT clas, nome, sexo FROM geral WHERE vestibulinho= '" + vg.Vestibulinho + "' AND habilitacao2='" + vg.Curso + "' AND chamada='2ª Opção') geral ORDER BY nome";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
Ejemplo n.º 17
0
 public DataTable SelecionaVagas(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string           receber = "SELECT DISTINCT periodo, vagas FROM vagas WHERE vestibulinho= '" + vg.Vestibulinho + "' AND curso= '" + vg.Curso + "'";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public void GravarSobras(Vagas vg)
 {
     if (vg.Banco.Remove(vg.Banco.Length - 9) == "1")
     {
         vg.Banco = "sobUm";
     }
     else if (vg.Banco.Remove(vg.Banco.Length - 9) == "2")
     {
         vg.Banco = "sobDois";
     }
     else if (vg.Banco.Remove(vg.Banco.Length - 9) == "3")
     {
         vg.Banco = "sobTres";
     }
     else if (vg.Banco.Remove(vg.Banco.Length - 9) == "4")
     {
         vg.Banco = "sobQuatro";
     }
     else if (vg.Banco.Remove(vg.Banco.Length - 9) == "5")
     {
         vg.Banco = "sobCinco";
     }
     else if (vg.Banco == "Pós Chamadas")
     {
         vg.Banco = "pos";
     }
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         string       alterar  = "UPDATE vagas SET " + vg.Banco + "='" + vg.Sobra + "'WHERE curso= '" + vg.Curso + "'AND vestibulinho='" + vg.Vestibulinho + "'AND periodo='" + vg.Periodo + "'";
         MySqlCommand comandos = new MySqlCommand(alterar, conexao);
         comandos.ExecuteNonQuery();
         conexao.Close();
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }
 public DataTable VerificaSobra(Vagas vg)
 {
     try
     {
         conexao = new MySqlConnection(caminho);
         conexao.Open();
         if (vg.Banco.Remove(vg.Banco.Length - 9) == "1")
         {
             vg.Banco = "sobUm";
         }
         else if (vg.Banco.Remove(vg.Banco.Length - 9) == "2")
         {
             vg.Banco = "sobDois";
         }
         else if (vg.Banco.Remove(vg.Banco.Length - 9) == "3")
         {
             vg.Banco = "sobTres";
         }
         else if (vg.Banco.Remove(vg.Banco.Length - 9) == "4")
         {
             vg.Banco = "sobQuatro";
         }
         else if (vg.Banco.Remove(vg.Banco.Length - 9) == "5")
         {
             vg.Banco = "sobCinco";
         }
         string           receber = "SELECT " + vg.Banco + " FROM vagas WHERE vestibulinho= '" + vg.Vestibulinho + "' AND curso= '" + vg.Curso + "'AND periodo= '" + vg.Periodo + "'";
         MySqlDataAdapter comand  = new MySqlDataAdapter(receber, conexao);
         DataTable        dt      = new System.Data.DataTable();
         comand.Fill(dt);
         conexao.Close();
         return(dt);
     }
     catch (Exception ex)
     {
         throw new Exception("Erro de comandos: " + ex.Message);
     }
 }