Casting numbers identify a particular raw casting; that raw casting is frequently machined into several slightly different finished parts, which carry unique PART numbers. One example is cylinder heads - the same casting was frequently machined both for 1.94"/1.5" valves and for 2.02"/1.6" valves, and those two variations carried different PART numbers after machining, although both types carry the same cast-in casting number. The P&A parts books show the finished PART number, and sometimes reference an "I.D." number, which is the casting number that appears on the part. PART numbers don't appear on castings, unless a casting was only machined into one finished part.
To carry the analogy further, a machined cylinder head that's bare (no valves, springs, etc.) will carry one PART number, and the same head assembled (with valves, springs, etc.) will carry yet another different PART number, although the machined casting is the same between the two.