public bool Equals(Setor setor) { if (setor == null) { return(false); } return(this.Setor.Equals(setor.setor_id)); }
public bool Update(Setor setor) { if (SetorDao.BuscarSetor(setor) == true) { return(true); } else { return(false); } //UsuariosDao.Ativa_Usuario(id); }
// public virtual Setor setor { get; set; } public override bool Equals(object obj) { if (obj == null) { return(false); } Setor objAsPart = obj as Setor; if (objAsPart == null) { return(false); } else { return(Equals(objAsPart)); } }
public static bool BuscarSetor(Setor setor) { using (SqlConnection sqlConnection = new SqlConnection(GetStringConexao())) { sqlConnection.Open(); using (SqlCommand sqlCommand = new SqlCommand("Select * from Setor where setor_nome = @nome", sqlConnection)) { sqlCommand.Parameters.AddWithValue("@nome", setor.setor_nome); SqlDataReader sqlDataReader = sqlCommand.ExecuteReader(); if (sqlDataReader.Read() == true) { sqlCommand.Parameters.Clear(); sqlConnection.Close(); return(true); } else { sqlCommand.Parameters.Clear(); sqlConnection.Close(); return(false); } } } }
public bool Get(Setor setor) { return(SetorDao.BuscarSetor(setor)); ///return usuario; }