C# Delete Attachments - Compile Errors

I’m trying to write some code that will delete all of the attachments on a PO line when the part number is changed. The syntax in the editor checks out, but I’m getting the below error when trying to save.
Not sure where these compile errors are coming from. Any ideas?

Trace Log:

          <localTime>5/16/2018 09:15:07:9118437 AM</localTime>
          <executionTime total="13" roundTrip="12" channel="0" bpm="0" other="1" />
            <parameter name="path" type="System.String"><![CDATA[\\ISIMKE\users\awillett\Epicor Files\RDD\RDD95925SOPickLv4.040918.xml]]></parameter>

          <localTime>5/16/2018 09:15:07:9320991 AM</localTime>
          <executionTime total="47" roundTrip="33" channel="0" bpm="0" other="14" />
            <parameter name="ds" type="Erp.BO.PODataSet">
              <PODataSet xmlns="http://www.epicor.com/Ice/300/BO/PO/PO" />
            <paramDataSet name="ds" useDataSetNbr="0">
              <deletedRow tableName="PODetailAttch" rowState="Deleted" rowNum="6" />


        var ttPODetailR = ttPODetail.FirstOrDefault(r=>r.Updated());
        const string RELATEDTYPE = "PODetail";
        const string RELATEDSCHEMA = "Erp";
        int iter = 0;

        if( ttPODetailR != null )
           string strPNum = ttPODetailR.PONUM.ToString();
           int pNum = (int)ttPODetailR.PONUM;
           string strPLine = ttPODetailR.POLine.ToString();
           int pLine = (int)ttPODetailR.POLine;

           var count = (
              from xa in Db.XFileAttch.With(LockHint.NoLock)
              where xa.Company==Session.CompanyID &&
                       xa.RelatedToFile==RELATEDTYPE &&
                       xa.RelatedToSchemaName==RELATEDSCHEMA &&
              select xa.AttachNum).Count();

           if( count > 0 )
              using( var poBO = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.POSvcContract>(Db))
                 POTableset poTS = new POTableset();
                 poTS = poBO.GetByID(pNum);
                 while( iter < count )
                    if( poTS.PODetailAttch[iter].POLine == pLine )
                       poTS.PODetailAttch[iter].RowMod = "D";
                 poBO.Update(ref poTS);


Nevermind, spaced out.
It was in my condition block before the code even hits.
I just assumed it was my code. :expressionless:
Carry on.