public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         var strQuery = string.Format(" DELETE FROM QUESTAO WHERE idQuestao = {0}", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" DELETE FROM CLIENTE WHERE ClienteId = {0} ", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" DELETE FROM PRODUTO WHERE ProdutoId = {0} ", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         var strQuery = string.Format(" DELETE FROM ATIVIDADE WHERE idAtividade = {0}", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" DELETE FROM CIDADE WHERE IdCidade = {0} ", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         var strQuery = string.Format(" DELETE FROM transportadora WHERE Codigo = {0}", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 private void Inserir(Estado estado)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" INSERT INTO ESTADO(NomeEstado) VALUES('{0}') ", estado.NomeEstado);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         var strQuery = string.Format(" DELETE FROM DISCIPLINA WHERE idDisciplina = {0}", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(string matricula)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" DELETE FROM " + this.bancoFrequencia + "FUNCIONARIO WHERE Matricula = '{0}' ", matricula);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         var strQuery = string.Format(" DELETE FROM TURMA WHERE idTurma = {0}", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" DELETE FROM SUPERVISOR2 WHERE Id = {0} ", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" DELETE FROM FUNCIONARIO WHERE IdFuncionario = {0} ", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 private void Inserir(Cidade cidade)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" INSERT INTO CIDADE(NomeCidade) VALUES('{0}') ", cidade.NomeCidade);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         string strQuery = string.Format(" DELETE FROM ESTADO WHERE IdEstado = {0} ", id);
         contexto.ExecutaComando(strQuery);
     }
 }
Example #15
0
        private void Alterar(Opcao opcap)
        {
            var strQuery = "";

            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
 public void Inserir(Funcionario funcionario)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " INSERT INTO " + this.bancoFrequencia + "FUNCIONARIO(Matricula, Funcao, LoginRede) ";
         strQuery += string.Format(" VALUES('{0}', '{1}', '{2}') ", funcionario.Matricula, funcionario.Funcao, funcionario.LoginRede);
         contexto.ExecutaComando(strQuery);
     }
 }
Example #17
0
        private void Alterar(RespostaAluno resposta)
        {
            var strQuery = "";

            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
 private void Alterar(Cidade cidade)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " UPDATE CIDADE SET ";
         strQuery += string.Format(" NomeCidade = '{0}' ", cidade.NomeCidade);
         strQuery += string.Format(" WHERE IdCidade = {0} ", cidade.IdCidade);
         contexto.ExecutaComando(strQuery);
     }
 }
 private void Alterar(Estado estado)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " UPDATE ESTADO SET ";
         strQuery += string.Format(" NomeEstado = '{0}' ", estado.NomeEstado);
         strQuery += string.Format(" WHERE IdEstado = {0} ", estado.IdEstado);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Inserir(Cliente cliente)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " INSERT INTO CLIENTE(Nome, Sobrenome, Email, DataCadastro, Ativo) ";
         strQuery += string.Format(" VALUES('{0}', '{1}', '{2}', '{3}', '{4}') ", cliente.Nome,
             cliente.Sobrenome, cliente.Email, cliente.DataCadastro, cliente.Ativo);
         contexto.ExecutaComando(strQuery);
     }
 }
        public void Inserir(Produto produto)
        {
            using (contexto = new Contexto())
            {
                string strQuery = " INSERT INTO PRODUTO(ProdutoNome, Valor, Disponivel, ClienteId) ";
                strQuery += string.Format(" VALUES('{0}', {1}, '{2}', {3}) ", produto.ProdutoNome,
                    produto.Valor, produto.Disponivel, produto.ClienteId);

                contexto.ExecutaComando(strQuery);
            }
        }
 public void Alterar(Funcionario funcionario)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " UPDATE " + this.bancoFrequencia + "FUNCIONARIO SET ";
         strQuery += string.Format(" Matricula = '{0}', ", funcionario.Matricula);
         strQuery += string.Format(" Funcao = '{0}', ", funcionario.Funcao);
         strQuery += string.Format(" LoginRede = '{0}' ", funcionario.LoginRede);
         strQuery += string.Format(" WHERE Matricula = '{0}' ", funcionario.Matricula);
         contexto.ExecutaComando(strQuery);
     }
 }
        private void Alterar(Atividade atividade)
        {
            var strQuery = "";

            strQuery += " UPDATE ATIVIDADE SET ";
            strQuery += string.Format(" estado = '{0}'", atividade.estado);
            strQuery += string.Format(" WHERE idAtividade = {0} ", atividade.idAtividade);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
Example #24
0
        private void Inserir(Opcao opcao)
        {
            var strQuery = "";

            strQuery += " INSERT INTO OPCAO (descricao, opcaoCorreta,idQuestao) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}') ",
                                      opcao.descricao, opcao.opcaoCorreta, opcao.idQuestao);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
Example #25
0
        private void Inserir(RespostaAluno resposta)
        {
            var strQuery = "";

            strQuery += " INSERT INTO RespostaAluno (idAluno,idQuestao,idResposta) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}') ",
                                      resposta.idAluno, resposta.idQuestao, resposta.idResposta);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Inserir(Atividade atividade)
        {
            var strQuery = "";

            strQuery += " INSERT INTO ATIVIDADE (descricao,ano,estado,idTurma,turma) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}','{3}','{4}') ",
                                      atividade.descricao, atividade.ano, atividade.estado, atividade.idTurma, atividade.turma);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Inserir(Turma turma)
        {
            var strQuery = "";

            strQuery += " INSERT INTO TURMA (nome,ano,idProfessor,idDisciplina) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}','{3}') ",
                                      turma.nome, turma.ano, turma.idProf, turma.idDisciplina)
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
Example #28
0
        private void Inserir(Score score)
        {
            var strQuery = "";

            strQuery += " INSERT INTO SCORE (score, idAtividade,idAluno)";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}') ",
                                      score.score, score.idAtividade, score.idAluno);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Inserir(Disciplina disciplina)
        {
            var strQuery = "";

            strQuery += " INSERT INTO DISCIPLINA (nome,tipo) ";
            strQuery += string.Format(" VALUES ('{0}','{1}') ",
                                      disciplina.nome, disciplina.tipo);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Inserir(Questao questao)
        {
            var strQuery = "";

            strQuery += " INSERT INTO QUESTAO (descricao, idAtividade) ";
            strQuery += string.Format(" VALUES ('{0}','{1}') ",
                                      questao.descricao, questao.idAtividade);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Alterar(Turma turma)
        {
            var strQuery = "";

            strQuery += " UPDATE TURMA SET ";
            strQuery += string.Format(" nome = '{0}', ", turma.nome);
            strQuery += string.Format(" ano = '{0}' ", turma.ano);
            strQuery += string.Format(" WHERE idTurma = {0} ", turma.idTurma);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Inserir(Aluno aluno)
        {
            var strQuery = "";

            strQuery += " INSERT INTO PESSOA (nome, telefone, sexo,dtNascimento,endereco,cpf,tipo,senha,login,idTurma,turma) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}') ",
                                      aluno.Nome, aluno.telAluno, aluno.sexoAluno, aluno.nascimentoAluno, aluno.enderecoAluno, aluno.cpfAluno, aluno.tipo = 1,
                                      aluno.senha, aluno.login, aluno.idTurma, aluno.turma);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Alterar(Disciplina disciplina)
        {
            var strQuery = "";

            strQuery += " UPDATE DISCIPLINA SET ";
            strQuery += string.Format(" nome = '{0}', ", disciplina.nome);
            strQuery += string.Format(" tipo = '{0}' ", disciplina.tipo);

            strQuery += string.Format(" WHERE idDisciplina = {0} ", disciplina.idDisciplina);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        public void Alterar(Produto produto)
        {
            using (contexto = new Contexto())
            {
                string strQuery = " UPDATE PRODUTO SET ";
                strQuery += string.Format(" ProdutoNome = '{0}', ", produto.ProdutoNome);
                strQuery += string.Format(" Valor = {0}, ", produto.Valor);
                strQuery += string.Format(" Disponivel = '{0}', ", produto.Disponivel);
                strQuery += string.Format(" ClienteId = {0} ", produto.ClienteId);
                strQuery += string.Format(" WHERE ProdutoId = {0} ", produto.ProdutoId);

                contexto.ExecutaComando(strQuery);
            }
        }
 public void Alterar(Cliente cliente)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " UPDATE CLIENTE SET ";
         strQuery += string.Format(" Nome = '{0}', ", cliente.Nome);
         strQuery += string.Format(" Sobrenome = '{0}', ", cliente.Sobrenome);
         strQuery += string.Format(" Email = '{0}', ", cliente.Email);
         strQuery += string.Format(" DataCadastro = '{0}', ", cliente.DataCadastro);
         strQuery += string.Format(" Ativo = '{0}' ", cliente.Ativo);
         strQuery += string.Format(" WHERE ClienteId = {0} ", cliente.ClienteId);
         contexto.ExecutaComando(strQuery);
     }
 }
        private void Inserir(Professor prof)
        {
            var strQuery = "";

            strQuery += " INSERT INTO PESSOA (nome, telefone, sexo,dtNascimento,endereco,cpf,tipo,formacao,senha,login) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}') ",
                                      prof.Nome, prof.telProf, prof.sexoProf, prof.nascimentoProf, prof.enderecoProf, prof.cpfProf, prof.tipo = 2, prof.formacao,
                                      prof.senha, prof.login);
            ;
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Alterar(Questao questao)
        {
            var strQuery = "";

            strQuery += " UPDATE QUESTAO SET ";
            strQuery += string.Format(" descricao = '{0}',", questao.descricao);
            strQuery += string.Format(" idAtividade = '{0}',", questao.idAtividade);


            strQuery += string.Format(" WHERE idQuestao = {0} ", questao.idQuestao);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
Example #38
0
        /// <summary>
        /// Avalia transportadora 
        /// </summary>
        /// <param name="t">Transportadora</param>
        /// <param name="avaliacao">Avaliacao</param>
        public void avaliarTransportadora(Transportadora t, int avaliacao)
        {
            var usuario = this.getUsuarioLogado();

            var strQuery = "";
            strQuery += "INSERT INTO usuario_avaliacao (Usuario_id, Transportadora_id, Avaliacao) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}') ",
                usuario.Id, t.Codigo, avaliacao
             );

            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
Example #39
0
        private void Alterar(Score score)
        {
            var strQuery = "";

            strQuery += " UPDATE SCORE SET ";
            strQuery += string.Format(" score = '{0}',", score.score);
            strQuery += string.Format(" idAtividade = '{0}',", score.idAtividade);
            strQuery += string.Format(" idAluno = '{0}',", score.idAluno);

            strQuery += string.Format(" WHERE idScore = {0} ", score.idScore);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
 private void Alterar(Funcionario funcionario)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " UPDATE FUNCIONARIO SET ";
         strQuery += string.Format(" Nome = '{0}', ", funcionario.Nome);
         strQuery += string.Format(" DataNascimento = '{0}', ", funcionario.DataNascimento);
         strQuery += string.Format(" CPF = '{0}', ", funcionario.CPF);
         strQuery += string.Format(" Cargo = '{0}', ", funcionario.Cargo);
         strQuery += string.Format(" Salario = {0}, ", funcionario.Salario);
         strQuery += string.Format(" IdCidade = {0}, ", funcionario.IdCidade);
         strQuery += string.Format(" IdEstado = {0} ", funcionario.IdEstado);
         strQuery += string.Format(" WHERE IdFuncionario = {0} ", funcionario.IdFuncionario);
         contexto.ExecutaComando(strQuery);
     }
 }
        private void Alterar(Aluno aluno)
        {
            var strQuery = "";

            strQuery += " UPDATE PESSOA SET ";
            strQuery += string.Format(" nome = '{0}',", aluno.Nome);
            strQuery += string.Format(" telefone = '{0}',", aluno.telAluno);
            strQuery += string.Format(" sexo = '{0}',", aluno.sexoAluno);
            strQuery += string.Format(" dtNascimento = '{0}',", aluno.nascimentoAluno);
            strQuery += string.Format(" endereco = '{0}',", aluno.enderecoAluno);
            strQuery += string.Format(" cpf = '{0}',", aluno.cpfAluno);
            strQuery += string.Format(" senha = '{0}',", aluno.senha);
            strQuery += string.Format(" login = '******'", aluno.login);

            strQuery += string.Format(" WHERE idPessoa = {0} ", aluno.idAluno);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        private void Alterar(Professor prof)
        {
            var strQuery = "";

            strQuery += " UPDATE PESSOA SET ";
            strQuery += string.Format(" nome = '{0}',", prof.Nome);
            strQuery += string.Format(" telefone = '{0}',", prof.telProf);
            strQuery += string.Format(" sexo = '{0}',", prof.sexoProf);
            strQuery += string.Format(" dtNascimento = '{0}',", prof.nascimentoProf);
            strQuery += string.Format(" endereco = '{0}',", prof.enderecoProf);
            strQuery += string.Format(" cpf = '{0}',", prof.cpfProf);

            strQuery += string.Format(" formacao = '{0}',", prof.formacao);
            strQuery += string.Format(" senha = '{0}',", prof.senha);
            strQuery += string.Format(" login = '******'", prof.login);
            strQuery += string.Format(" WHERE idPessoa = {0} ", prof.idProf);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
 private void Inserir(Funcionario funcionario)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " INSERT INTO FUNCIONARIO(Nome, DataNascimento, CPF, Cargo, Salario, IdCidade, IdEstado) ";
         strQuery += string.Format(" VALUES('{0}', '{1}', '{2}','{3}', {4}, {5}, {6}) ", funcionario.Nome, funcionario.DataNascimento,
             funcionario.CPF, funcionario.Cargo, funcionario.Salario, funcionario.IdCidade, funcionario.IdEstado);
         contexto.ExecutaComando(strQuery);
     }
 }
        private void Alterar(Supervisor supervisor)
        {
            using (contexto = new Contexto())
            {
                string strQuery = " UPDATE SUPERVISOR2 SET ";
                strQuery += string.Format(" Resposta1 = '{0}', ", supervisor.Resposta1);
                strQuery += string.Format(" Resposta2 = '{0}', ", supervisor.Resposta2);
                strQuery += string.Format(" Resposta3 = '{0}', ", supervisor.Resposta3);
                strQuery += string.Format(" Resposta4 = '{0}', ", supervisor.Resposta4);
                strQuery += string.Format(" LoginRede = '{0}' ", supervisor.LoginRede);
                strQuery += string.Format(" WHERE Id = {0} ", supervisor.Id);

                contexto.ExecutaComando(strQuery);
            }
        }
 private void Inserir(Supervisor supervisor)
 {
     using (contexto = new Contexto())
     {
         string strQuery = " INSERT INTO SUPERVISOR2(Resposta1, Resposta2, Resposta3, Resposta4, LoginRede) ";
         strQuery += string.Format(" VALUES('{0}', '{1}', '{2}', '{3}', '{4}') ", supervisor.Resposta1, supervisor.Resposta2,
             supervisor.Resposta3, supervisor.Resposta4, supervisor.LoginRede);
         contexto.ExecutaComando(strQuery);
     }
 }
        /// <summary>
        /// Insere uma tranportadora
        /// </summary>
        /// <param name="t">Transportadora a ser inserida</param>
        private void Inserir(Transportadora t)
        {
            var strQuery = "";
            strQuery += "INSERT INTO transportadora (Nome, Telefone, Endereco, Email, InscricaoEstadual, Cnpj) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}', '{3}','{4}' ,'{5}') ",
                t.Nome, t.Telefone, t.Endereco, t.Email, t.InscricaoEstadual,t.Cnpj
             );

            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
        /// <summary>
        /// Alterar uma tranportadora
        /// </summary>
        /// <param name="t">Transportadora para edicao</param>
        private void Alterar(Transportadora t)
        {
            var strQuery = "";
            strQuery += " UPDATE transportadora SET ";
            strQuery += string.Format(" Nome = '{0}', ", t.Nome);
            strQuery += string.Format(" Telefone = '{0}', ", t.Telefone);
            strQuery += string.Format(" Endereco = '{0}', ", t.Endereco);
            strQuery += string.Format(" Email = '{0}', ", t.Email);
            strQuery += string.Format(" InscricaoEstadual = '{0}', ", t.InscricaoEstadual);
            strQuery += string.Format(" Cnpj = '{0}'", t.Cnpj);
            strQuery += string.Format(" WHERE Codigo = {0} ", t.Codigo);

            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
 private void Inserir(Operador operador)
 {
     using (contexto = new Contexto())
        {
        string strQuery = " INSERT INTO OPERADOR2(Resposta1, Resposta2, Resposta3, Resposta4, Resposta5, DataPesquisa, LoginRede) ";
        strQuery += string.Format(" VALUES('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}') ", operador.Resposta1, operador.Resposta2,
            operador.Resposta3, operador.Resposta4, operador.Resposta5, DateTime.Now, operador.LoginRede);
        contexto.ExecutaComando(strQuery);
        }
 }
        private void Alterar(Operador operador)
        {
            using (contexto = new Contexto())
               {
               string strQuery = " UPDATE OPERADOR2 SET ";
               strQuery += string.Format(" Resposta1 = '{0}', ", operador.Resposta1);
               strQuery += string.Format(" Resposta2 = '{0}', ", operador.Resposta2);
               strQuery += string.Format(" Resposta3 = '{0}', ", operador.Resposta3);
               strQuery += string.Format(" Resposta4 = '{0}', ", operador.Resposta4);
               strQuery += string.Format(" Resposta5 = '{0}', ", operador.Resposta5);
               strQuery += string.Format(" LoginRede = '{0}' ", operador.LoginRede);
               strQuery += string.Format(" WHERE Id = {0} ", operador.Id);

               contexto.ExecutaComando(strQuery);
               }
        }