public object Empregados(string ordem = "", string direcao = "ASC") { var bd = new Banco(); string sql = "select EmployeeID, FirstName, LastName, Title from employees"; if (!string.IsNullOrEmpty(direcao) && direcao.ToUpper() == "ASC" || direcao.ToUpper() == "DESC") { sql += " order by " + ordem + " " + direcao; } bd.ComandoSQL.CommandText = sql; return bd.ExecutaSelect(); ; }
public void ExcluirRegistro(int cod) { var bd = new Banco(); bd.ComandoSQL.CommandText = "delete from employees where EmployeeID = @id"; bd.ComandoSQL.Parameters.AddWithValue("@id", cod); try { msgLog.Visible = !(bd.ExecutaComando(false) > 0); } catch (Exception) { msgLog.Visible = false; } }