예제 #1
0
 public bool Equals(Setor setor)
 {
     if (setor == null)
     {
         return(false);
     }
     return(this.Setor.Equals(setor.setor_id));
 }
예제 #2
0
 public bool Update(Setor setor)
 {
     if (SetorDao.BuscarSetor(setor) == true)
     {
         return(true);
     }
     else
     {
         return(false);
     }
     //UsuariosDao.Ativa_Usuario(id);
 }
예제 #3
0
        // 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));
            }
        }
예제 #4
0
 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);
             }
         }
     }
 }
예제 #5
0
 public bool Get(Setor setor)
 {
     return(SetorDao.BuscarSetor(setor));
     ///return usuario;
 }