I'm trying to use this PHIEUTHU sequence in AR302000 Payment and application screen to

auto fill in ExtRefNbr text field

Here is the code I wrote:
protected void ARPayment_RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
base.ARPayment_RowPersisting(sender, e);
//var row = (ARPayment)e.Row;
if (this.IsImport)
{
if ((e.Operation & PXDBOperation.Command) == PXDBOperation.Insert)
{
String numbering = ARSetup.Current.ExtRefNbr;
Boolean autonumber = true;
if (numbering != null)
{
Numbering num = PXSelect<Numbering, Where<Numbering.numberingID, Equal<Required<Numbering.numberingID>>>>.Select(this, numbering);
if (num != null && num.UserNumbering == true)
{
autonumber = false;
}
}}
}
var payment = (ARPayment)e.Row;
if (autonumber == false)
{
AutoNumberAttribute.SetNumberingId<APPayment.refNbr>(this.Document.Cache, payment.DocType, numbering);
}
}
\App_RuntimeCode\ARPaymentEntry.cs(33): error CS0117: 'PX.Data.PXGraphExtension' does not contain a definition for 'ARPayment_RowPersisting' \App_RuntimeCode\ARPaymentEntry.cs(33): error CS0103: The name 'sender' does not exist in the current context \App_RuntimeCode\ARPaymentEntry.cs(35): error CS1061: 'PX.Objects.AR.ARPaymentEntry_Extension' does not contain a definition for 'IsImport' and no extension method 'IsImport' accepting a first argument of type 'PX.Objects.AR.ARPaymentEntry_Extension' could be found (are you missing a using directive or an assembly reference?) \App_RuntimeCode\ARPaymentEntry.cs(39): error CS0117: 'PX.Objects.AR.ARSetup' does not contain a definition for 'Current' \App_RuntimeCode\ARPaymentEntry.cs(43): error CS0120: An object reference is required for the non-static field, method, or property 'PX.Data.PXSelectBase.Select(params object[])' \App_RuntimeCode\ARPaymentEntry.cs(54): error CS0103: The name 'autonumber' does not exist in the current context \App_RuntimeCode\ARPaymentEntry.cs(56): error CS0246: The type or namespace name 'APPayment' could not be found (are you missing a using directive or an assembly reference?) \App_RuntimeCode\ARPaymentEntry.cs(56): error CS1061: 'PX.Objects.AR.ARPaymentEntry_Extension' does not contain a definition for 'Document' and no extension method 'Document' accepting a first argument of type 'PX.Objects.AR.ARPaymentEntry_Extension' could be found (are you missing a using directive or an assembly reference?) \App_RuntimeCode\ARPaymentEntry.cs(56): error CS0103: The name 'numbering' does not exist in the current context \App_RuntimeCode\ARPaymentEntry.cs(33): error CS0117: 'PX.Data.PXGraphExtension' does not contain a definition for 'ARPayment_RowPersisting'
My uploade included pictures, please take a look! Help me with step by step please, I'm newbie. Thank for helping me !

