예제 #1
0
        public SqlDataReader iniciaSessao(string cpf, string senha)
        {
            SqlCommand cmd = new SqlCommand("spIniciaSessao", Conexao.Conectar());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@CPF", cpf);
            cmd.Parameters.AddWithValue("@Senha", senha);
            da = cmd.ExecuteReader();
            return(da);
        }
예제 #2
0
        public DataTable CarregaEndereco(string Cpf)
        {
            DataTable  tabela = new DataTable();
            SqlCommand cm     = new SqlCommand("[dbo].[spEnderecoPorCpf]", Conexao.Conectar());

            cm.CommandType = CommandType.StoredProcedure;
            cm.Parameters.AddWithValue("@cpf", Convert.ToString(Cpf));
            SqlDataAdapter da = new SqlDataAdapter(cm);

            da.Fill(tabela);
            return(tabela);
        }
예제 #3
0
        public void Incluir(TipoUsuario modelo)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = Conexao.ObjetoConexao;
            cmd.CommandText = "[dbo].[spTipoUsuarioInsert]";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@nome", modelo.Descricao);
            Conexao.Conectar();
            cmd.ExecuteNonQuery();
            Conexao.Desconectar();
        }
예제 #4
0
        public void Alterar(TipoEquipamento modelo)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = Conexao.ObjetoConexao;
            cmd.CommandText = "[dbo].[spTipoEquipamentoUpdate]";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Id", modelo.TipoEquipamentoId);
            cmd.Parameters.AddWithValue("@descricao", modelo.Descricao);
            Conexao.Conectar();
            cmd.ExecuteNonQuery();
            Conexao.Desconectar();
        }
예제 #5
0
        public DataTable CarregarCombo()
        {
            DataTable  tabela = new DataTable();
            SqlCommand cm     = new SqlCommand("[dbo].[spSexo]", Conexao.Conectar());

            cm.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cm);

            da.Fill(tabela);
            return(tabela);
        }