-
-
Save jvanhoesen/58a2c6105789c632994d51a87fce3b24 to your computer and use it in GitHub Desktop.
Status field and attribute declaration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AATimeRequestStatus | |
{ | |
public const string OnHold = "H"; | |
public const string PendingApproval = "P"; | |
public const string Approved = "A"; | |
public const string Rejected = "R"; | |
public class onHold : BqlString.Constant<onHold> | |
{ | |
public onHold() : base(OnHold) | |
{ | |
} | |
} | |
public class pendingApproval : BqlString.Constant<pendingApproval> | |
{ | |
public pendingApproval() : base(PendingApproval) | |
{ | |
} | |
} | |
public class approved : BqlString.Constant<approved> | |
{ | |
public approved() : base(Approved) | |
{ | |
} | |
} | |
public class rejected : BqlString.Constant<rejected> | |
{ | |
public rejected() : base(Rejected) | |
{ | |
} | |
} | |
public class AATimeRequestStatusListAttribute : PXStringListAttribute | |
{ | |
public AATimeRequestStatusListAttribute() : base( | |
new string[] | |
{ | |
OnHold, | |
PendingApproval, | |
Approved, | |
Rejected | |
}, | |
new string[] | |
{ | |
"On Hold", | |
"Pending Approval", | |
"Approved", | |
"Rejected" | |
}) | |
{ | |
} | |
} | |
} | |
//Use of attribute on status field decleration | |
#region Status | |
public abstract class status : BqlString.Field<status> | |
{ | |
} | |
[PXDBString(1, IsFixed = true)] | |
[PXDefault(AATimeRequestStatus.OnHold)] | |
[AATimeRequestStatus.AATimeRequestStatusList] | |
[PXUIField(DisplayName = "Status")] | |
public virtual string Status { get; set; } | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment