1-1 correspondence of class group of an order '$\mathcal{O}$' and elliptic curves having complex multiplication by $\mathcal{O}$

I came across these two results

1. Let $\mathcal{O}$ be an order in an imaginary quadratic field.There is a 1−1 correspondence between the ideal class group $C(\mathcal{O})$ and the homo-thety classes of lattices with $\mathcal{O}$ as their full ring of complex multiplication.
2. There is a 1-1 correspondence between invertible ideal classes of ring $\mathcal{O}$ and the set of triples $$\left\{(a,b,c) \in \mathbb{Z}^3:{\begin{split}& a>0;\ \gcd(a,b,c)=1 ;\\&|b| \leq a\leq c;\ b^2-4ac=D;\\& b\ >0\text{ whenever }|b|=a\text{ or }a=c\end{split} }\right\}$$ where $D$ is the discriminant of the number ring $\mathcal{O}$

My question is how can I relate both of these results, It looks to me that $2$ can be inferred from $1$. Any refrence for the same would be of great help.

The reference of this answer is D. Cox 'Primes of the form $x^2+ny^2$'. The formulation 1 is Theorem 10.14 and Corollary 10.20, and 2 is Theorem 7.7 (ii).

Then it is more natural that 1 is inferred from 2, than 2 is inferred from 1. The elements in the set of triples described in 2, can be considered as a set of equivalence classes of quadratic forms $C(D)$ with discriminant $D$ where $D$ is the discriminant of $\mathcal{O}$.

We write a lattice $L$ generated by $\alpha$ and $\beta$ as $L=[\alpha, \beta]$. This means $L=\{ m\alpha+n\beta: m, n \in \mathbb{Z}\}$.
We write $L\sim L'$ if two lattices $L$ and $L'$ are homothetic (i.e. nonzero multiple of each other).

The two statements are far apart in the book, but we can relate them via points in the fundamental domain for $\Gamma_1 = \mathrm{SL}(2,\mathbb{Z})$.

First, for any lattice $L$ in $\mathbb{C}$, there is a nonzero $\lambda\in\mathbb{C}$ such that $L=\lambda [1,z]$ with $z$ in the upper half plane $\mathbb{H}$. Then $L\sim [1,z]$.

Also, it is shown in chapter 10 of the book, that two lattices $L$ and $L'$ are homothetic if and only if $j(L)=j(L')$. Here $j(L)$ means the $j$-invariant of the lattice $L$.

Moreover, we can regard $j$ as a function from the upper half plane $\mathbb{H}$ to $\mathbb{C}$. This is easy to check: if $L\sim [1,z]$, we set $j(z) = j(L)$.

The bijection in 2, maps an element $ax^2+b xy+cy^2$ in $C(D)$ to $[a, \frac{-b+\sqrt{D}}2]$ in $C(\mathcal{O})$. This fractional $\mathcal{O}$-ideal is homothetic to $[1,\tau]$ where $\tau = \frac{-b+\sqrt{D}}{2a}$. The restrictions described in 2, put the point $\tau$ in the fundamental domain $\mathcal{F}$ for $\Gamma_1 = \mathrm{SL}(2,\mathbb{Z})$.

An important property of $j$ function is that the $j$ function is injective on $\mathcal{F}$. Thus, for any distinct points $z$, $z'$ in $\mathcal{F}$, we have $j(z)\neq j(z')$. Equivalently, $[1,z]\not\sim [1,z']$.

Since the $\tau$ obtained from the quadratic form $ax^2+bxy+cy^2$ with the restrictions in 2, is uniquely determined for each forms. This means that distinct triples in 2, will give different $\tau$. Thus, we obtain the statement 1, since distinct ideal classes in $C(\mathcal{O})$ fall in distinct homothety classes.

From this point of view, it is easy to see that $C(D)=C(\mathcal{O})$ is finite. To see this, consider $\tau$ obtained from $ax^2+bxy+cy^2$. Then the possibilities for $a$ is finite, since $\mathcal{F}$ is positive distance away from the real axis. The possibilities for $b$ is also finite, since $|b|\leq a$.