예제 #1
0
        public int CancelarMatricula(MatriculaDTO _item)
        {
            RepGen <MatriculaDTO> sqlCommand = new RepGen <MatriculaDTO>();

            string query = "UPDATE TB_Matricula SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@dtCancelamento", DateTime.Now, DbType.DateTime);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", _item.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idMatricula = " + _item.idMatricula.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #2
0
        public int UpdateData(FrequenciaDTO _item)
        {
            RepGen <FrequenciaDTO> sqlCommand = new RepGen <FrequenciaDTO>();

            string query = "UPDATE TB_Frequencia SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@dtFrequencia", _item.dtFrequencia, DbType.DateTime);
            param.Add("@idTurma", _item.idTurma, DbType.Int32);
            param.Add("@idDisciplina", _item.idDisciplina, DbType.Int32);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", _item.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idFrequencia = " + _item.idTurma.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #3
0
파일: ContatoDAL.cs 프로젝트: br2kdev/Somar
        public int UpdateData(ContatoDTO objectDTO)
        {
            RepList <ContatoDTO> listEndereco = new RepList <ContatoDTO>();
            RepGen <ContatoDTO>  sqlCommand   = new RepGen <ContatoDTO>();

            string query = "UPDATE TB_Contatos SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@idPai", objectDTO.idPai, DbType.Int32);
            param.Add("@idMae", objectDTO.idMae, DbType.Int32);
            param.Add("@telefone1", objectDTO.telefone1, DbType.String);
            param.Add("@contato1", objectDTO.contato1, DbType.String);
            param.Add("@telefone2", objectDTO.telefone2, DbType.String);
            param.Add("@contato2", objectDTO.contato2, DbType.String);
            param.Add("@telefone3", objectDTO.telefone3, DbType.String);
            param.Add("@contato3", objectDTO.contato3, DbType.String);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idContato = " + objectDTO.idContato.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #4
0
파일: EscolaDAL.cs 프로젝트: br2kdev/Somar
        public int UpdateData(EscolaDTO objectDTO)
        {
            RepList <EscolaDTO> listProjeto = new RepList <EscolaDTO>();
            RepGen <EscolaDTO>  sqlCommand  = new RepGen <EscolaDTO>();

            string query = "UPDATE TB_ESCOLAS SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@nomeEscola", objectDTO.nomeEscola, DbType.String);
            param.Add("@observacoes", objectDTO.observacoes, DbType.String);
            param.Add("@idEndereco", objectDTO.idEndereco, DbType.Int32);
            param.Add("@flagAtivo", objectDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", objectDTO.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idEscola = " + objectDTO.idEscola.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #5
0
파일: UsuarioDAL.cs 프로젝트: br2kdev/Somar
        public int UpdatePassword(UsuarioDTO objectDTO)
        {
            RepList <UsuarioDTO> listProjeto = new RepList <UsuarioDTO>();
            RepGen <UsuarioDTO>  sqlCommand  = new RepGen <UsuarioDTO>();

            string query = "UPDATE TB_Usuarios SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@senha", objectDTO.senha, DbType.String);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idUsuario = " + objectDTO.idUsuario.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #6
0
파일: UsuarioDAL.cs 프로젝트: br2kdev/Somar
        public int UpdateData(UsuarioDTO objectDTO)
        {
            RepList <UsuarioDTO> listProjeto = new RepList <UsuarioDTO>();
            RepGen <UsuarioDTO>  sqlCommand  = new RepGen <UsuarioDTO>();

            string query = "UPDATE TB_Usuarios SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@nomeUsuario", objectDTO.nomeUsuario, DbType.String);
            param.Add("@login", objectDTO.login, DbType.String);
            //param.Add("@senha", objectDTO.senha, DbType.String);
            param.Add("@idPerfil", objectDTO.idPerfil, DbType.Int32);
            param.Add("@flagAtivo", objectDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", objectDTO.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idUsuario = " + objectDTO.idUsuario.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #7
0
        public int UpdateData(EnderecoDTO objectDTO)
        {
            RepList <EnderecoDTO> listEndereco = new RepList <EnderecoDTO>();
            RepGen <EnderecoDTO>  sqlCommand   = new RepGen <EnderecoDTO>();

            string query = "UPDATE TB_Enderecos SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@CEP", objectDTO.CEP, DbType.String);
            param.Add("@logradouro", objectDTO.logradouro, DbType.String);
            param.Add("@complemento", objectDTO.complemento, DbType.String);
            param.Add("@numero", objectDTO.numero, DbType.String);
            param.Add("@idBairro", objectDTO.idBairro, DbType.Int32);
            param.Add("@nomeBairro", objectDTO.nomeBairro, DbType.String);
            param.Add("@idCidade", objectDTO.idCidade, DbType.Int32);
            param.Add("@nomeCidade", objectDTO.nomeCidade, DbType.String);
            param.Add("@siglaUF", objectDTO.siglaUF, DbType.String);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idEndereco = " + objectDTO.idEndereco.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #8
0
        public int ExcluirMatricula(MatriculaDTO _item)
        {
            RepGen <MatriculaDTO> sqlCommand = new RepGen <MatriculaDTO>();

            string query = "DELETE TB_Matricula Where idMatricula = " + _item.idMatricula;

            var param = new DynamicParameters();

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #9
0
        public int UpdateData(PessoaDTO objectDTO)
        {
            RepList <PessoaDTO> listProjeto = new RepList <PessoaDTO>();
            RepGen <PessoaDTO>  sqlCommand  = new RepGen <PessoaDTO>();

            string query = "UPDATE TB_Pessoas SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@nomePessoa", objectDTO.nomePessoa, DbType.String);
            param.Add("@dtNascimento", objectDTO.dtNascimento, DbType.DateTime);
            param.Add("@idTipoPessoa", objectDTO.idTipoPessoa, DbType.Int32);
            param.Add("@idGenero", objectDTO.idGenero, DbType.Int32);
            param.Add("@dtAtivacao", objectDTO.dtAtivacao, DbType.DateTime);
            param.Add("@numeroRG", objectDTO.numeroRG, DbType.String);
            param.Add("@numeroCPF", objectDTO.numeroCPF, DbType.String);
            param.Add("@observacoes", objectDTO.observacoes, DbType.String);
            param.Add("@idEndereco", objectDTO.idEndereco, DbType.Int32);
            param.Add("@idContato", objectDTO.idContato, DbType.Int32);
            param.Add("@idEscola", objectDTO.idEscola, DbType.Int32);
            param.Add("@fotoBase64", objectDTO.fotoBase64, DbType.String);
            param.Add("@flagResponsavel", objectDTO.flagResponsavel, DbType.Int32);
            param.Add("@idSituacao", objectDTO.idSituacao, DbType.Int32);
            param.Add("@flagAtivo", objectDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", objectDTO.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idPessoa = " + objectDTO.idPessoa.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #10
0
        public int UpdateData(ProjetoDTO objectDTO)
        {
            RepList <ProjetoDTO> listProjeto = new RepList <ProjetoDTO>();
            RepGen <ProjetoDTO>  sqlCommand  = new RepGen <ProjetoDTO>();

            string query = "UPDATE TB_Projetos SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@nomeProjeto", objectDTO.nomeProjeto, DbType.String);
            param.Add("@descricaoProjeto", objectDTO.descricaoProjeto, DbType.String);

            param.Add("@dtInicio", objectDTO.dtInicio, DbType.Date);
            param.Add("@dtTermino", objectDTO.dtTermino, DbType.Date);

            //param.Add("@idPessoaResposavel", objectDTO.idPessoaResposavel, DbType.Int32);
            param.Add("@nomeResposavel", objectDTO.nomeResposavel, DbType.String);
            param.Add("@flagAtivo", objectDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", objectDTO.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idProjeto = " + objectDTO.idProjeto.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
예제 #11
0
파일: TurmaDAL.cs 프로젝트: br2kdev/Somar
        public int UpdateData(TurmaDTO _turmaDTO)
        {
            RepList <TurmaDTO> listProjeto = new RepList <TurmaDTO>();
            RepGen <TurmaDTO>  sqlCommand  = new RepGen <TurmaDTO>();

            string query = "UPDATE TB_Turmas SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@nomeTurma", _turmaDTO.nomeTurma, DbType.String);
            param.Add("@descricaoTurma", _turmaDTO.descricaoTurma, DbType.String);
            param.Add("@descricaoPeriodo", _turmaDTO.descricaoPeriodo, DbType.String);
            param.Add("@horaInicio", _turmaDTO.horaInicio, DbType.String);
            param.Add("@horaTermino", _turmaDTO.horaTermino, DbType.String);
            param.Add("@idPessoaEducador", _turmaDTO.idPessoaEducador, DbType.Int32);
            param.Add("@flagAtivo", _turmaDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", _turmaDTO.idPessoaUltAlteracao, DbType.Int32);
            param.Add("@idProjeto", _turmaDTO.idProjeto, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idTurma = " + _turmaDTO.idTurma.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }