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); }
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); }
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(); }
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(); }
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); }