Ejemplo n.º 1
0
 public void Excluir(Aluno aluno)
 {
     using (contexto = new Contexto())
     {
         var strQuery = string.Format(" DELETE FROM ALUNO WHERE AlunoId = {0}", aluno.Id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Excluir(int id)
 {
     using (contexto = new Contexto())
     {
         var strQuery = string.Format(" DELETE FROM ALUNO WHERE AlunoId = {0}", id);
         contexto.ExecutaComando(strQuery);
     }
 }
 public void Deletar(int id)
 {
     var strQuery = string.Format("DELETE FROM Aluno WHERE AlunoId = {0}", id);
     using (contexto = new Contexto())
     {
         contexto.ExecutaComando(strQuery);
     }
 }
        public void Alterar(Aluno aluno)
        {
            var strQuery = string.Format("UPDATE Aluno SET Nome = '{0}' , Mae = '{1}' , DataNascimento = '{2}' WHERE AlunoId = {3}", aluno.Nome,
                aluno.Mae, aluno.DataNascimento, aluno.Id);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }

        }
        public void Inserir(Aluno aluno)
        {
            string strQuery = string.Format("INSERT INTO Aluno (Nome,Mae,DataNascimento) VALUES ('{0}','{1}','{2}')",
                aluno.Nome, aluno.Mae, aluno.DataNascimento);

            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
 private void Inserir(Aluno aluno)
 {
     var strQuery = "";
     strQuery += " INSERT INTO ALUNO (Nome, Mae, DataNascimento) ";
     strQuery += string.Format(" VALUES ('{0}','{1}','{2}') ",
         aluno.Nome, aluno.Mae, aluno.DataNascimento
         );
     using (contexto = new Contexto())
     {
         contexto.ExecutaComando(strQuery);
     }
 }
 private void Alterar(Aluno aluno)
 {
     var strQuery = "";
     strQuery += " UPDATE ALUNO SET ";
     strQuery += string.Format(" Nome = '{0}', ", aluno.Nome);
     strQuery += string.Format(" Mae = '{0}', ", aluno.Mae);
     strQuery += string.Format(" DataNascimento = '{0}' ", aluno.DataNascimento);
     strQuery += string.Format(" WHERE AlunoId = {0} ", aluno.Id);
     using (contexto = new Contexto())
     {
         contexto.ExecutaComando(strQuery);
     }
 }
Ejemplo n.º 8
0
        private void Inserir(Aluno aluno)
        {
            var strQuery = "";

            strQuery += " INSERT INTO ALUNO (Nome, Mae, DataNascimento) ";
            strQuery += string.Format(" VALUES ('{0}','{1}','{2}') ",
                                      aluno.Nome, aluno.Mae, aluno.DataNascimento
                                      );
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }
Ejemplo n.º 9
0
        private void Alterar(Aluno aluno)
        {
            var strQuery = "";

            strQuery += " UPDATE ALUNO SET ";
            strQuery += string.Format(" Nome = '{0}', ", aluno.Nome);
            strQuery += string.Format(" Mae = '{0}', ", aluno.Mae);
            strQuery += string.Format(" DataNascimento = '{0}' ", aluno.DataNascimento);
            strQuery += string.Format(" WHERE AlunoId = {0} ", aluno.Id);
            using (contexto = new Contexto())
            {
                contexto.ExecutaComando(strQuery);
            }
        }