There is a rich and well-known theory concerning the question:
What are the (necessary and sufficient) conditions that an integer $n$ must satisfy in order to be representable by a given quadratic form $ax^2+bxy+cy^2$, i.e. in order for it to be true that there exist integers $x,y$ such that $n=ax^2+bxy+cy^2$ ?
Fermat's two squares theorem is the classical example. The question is basically completely answered, with the modern form of the answer explained (for example) in Cox's famous book "Primes of the form $x^2+ny^2$", where it is explained how to find two polynomial congruences that when satisfied, a prime is representable by the quadratic form (the change of variables to the form $x^2+ny^2$ is not difficult, as is the reduction of the problem to primes).
However, the question is also very interesting for inhomogeneous quadratic forms:
What are the (necessary and sufficient) conditions that an integer $n$ must satisfy in order to be representable by a given inhomogeneous quadratic form $ax^2+bxy+cy^2+dx+ey+f$?
I tried completing the square to reduce to the usual case, but it doesn't seem to work here, because the left-hand side (with $n$) is not a multiple of $n$ anymore. I tried to look for references, but couldn't find anything. Is anything at all known about this question?