Skip to content

Commit d78050a

Browse files
committed
EDU-8355: Updated customization project and snippets.
1 parent fa60b29 commit d78050a

74 files changed

Lines changed: 2444 additions & 2378 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Customization/T250/CodeSnippets/Activity1.1.1/Step3/RSSVPaymentPlanInq.cs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace PhoneRepairShop
1111
public class RSSVPaymentPlanInq : PXGraph<RSSVPaymentPlanInq>
1212
{
1313
public PXFilter<MasterTable> MasterView;
14-
public PXFilter<DetailsTable> DetailsView = null!;
14+
public PXFilter<DetailsTable> DetailsView;
1515

1616
[Serializable]
1717
public class MasterTable : PXBqlTable, IBqlTable
@@ -28,21 +28,19 @@ public class DetailsTable : PXBqlTable, IBqlTable
2828
////////// The added code
2929
protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
3030
{
31-
using (new PXConnectionScope())
32-
{
33-
if (e.Row == null) return;
34-
if (e.Row.OrderTotal == 0) return;
35-
RSSVWorkOrderToPay order = e.Row;
36-
var invoices =
37-
SelectFrom<ARInvoice>.
38-
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.
39-
View.Select(this, order.InvoiceNbr);
40-
if (invoices.Count == 0)
41-
return;
42-
ARInvoice first = invoices[0];
43-
e.Row.PercentPaid = (order.OrderTotal - first.CuryDocBal) /
44-
order.OrderTotal * 100;
45-
}
31+
if (e.Row == null) return;
32+
if (e.Row.OrderTotal == 0) return;
33+
RSSVWorkOrderToPay order = e.Row;
34+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
35+
var invoices =
36+
SelectFrom<ARInvoice>.
37+
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.
38+
View.Select(this, order.InvoiceNbr);
39+
if (invoices.Count == 0)
40+
return;
41+
ARInvoice first = invoices[0];
42+
e.Row.PercentPaid = (order.OrderTotal - first.CuryDocBal) /
43+
order.OrderTotal * 100;
4644
}
4745
////////// The end of added code
4846
}

Customization/T250/CodeSnippets/Activity1.1.1/Step4/RSSVPaymentPlanInq.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ public class RSSVPaymentPlanInq : PXGraph<RSSVPaymentPlanInq>
1010
{
1111
////////// The added code
1212
[PXFilterable]
13-
public SelectFrom<RSSVWorkOrderToPay>.
14-
InnerJoin<ARInvoice>.On<ARInvoice.refNbr.
13+
public
14+
SelectFrom<RSSVWorkOrderToPay>.
15+
InnerJoin<ARInvoice>.On<ARInvoice.refNbr.
1516
IsEqual<RSSVWorkOrderToPay.invoiceNbr>>.
1617
Where<RSSVWorkOrderToPay.status.
1718
IsNotEqual<RSSVWorkOrderEntry_Workflow.States.paid>>.
@@ -25,6 +26,7 @@ protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
2526
if (e.Row == null) return;
2627
if (e.Row.OrderTotal == 0) return;
2728
RSSVWorkOrderToPay order = e.Row;
29+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
2830
var invoices =
2931
SelectFrom<ARInvoice>.
3032
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.

Customization/T250/CodeSnippets/Activity1.2.1/Step1/RSSVPaymentPlanInq.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
2323
if (e.Row == null) return;
2424
if (e.Row.OrderTotal == 0) return;
2525
RSSVWorkOrderToPay order = e.Row;
26+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
2627
var invoices =
2728
SelectFrom<ARInvoice>.
2829
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.

Customization/T250/CodeSnippets/Activity1.2.1/Step2/RSSVPaymentPlanInq.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
3939
if (e.Row == null) return;
4040
if (e.Row.OrderTotal == 0) return;
4141
RSSVWorkOrderToPay order = e.Row;
42+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
4243
var invoices =
4344
SelectFrom<ARInvoice>.
4445
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.

Customization/T250/CodeSnippets/Activity1.3.1/Step2/RSSVPaymentPlanInq.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
9595
if (e.Row == null) return;
9696
if (e.Row.OrderTotal == 0) return;
9797
RSSVWorkOrderToPay order = e.Row;
98+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
9899
var invoices =
99100
SelectFrom<ARInvoice>.
100101
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.

Customization/T250/CodeSnippets/Activity1.4.1/Step1/RSSVPaymentPlanInq.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
7878
if (e.Row == null) return;
7979
if (e.Row.OrderTotal == 0) return;
8080
RSSVWorkOrderToPay order = e.Row;
81+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
8182
var invoices =
8283
SelectFrom<ARInvoice>.
8384
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.

Customization/T250/CodeSnippets/Activity1.4.1/Step3/RSSVPaymentPlanInq.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
111111
if (e.Row == null) return;
112112
if (e.Row.OrderTotal == 0) return;
113113
RSSVWorkOrderToPay order = e.Row;
114+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
114115
var invoices =
115116
SelectFrom<ARInvoice>.
116117
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.

Customization/T250/CodeSnippets/Activity1.5.2/Step1/RSSVPaymentPlanInq.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ protected virtual void _(Events.RowSelecting<RSSVWorkOrderToPay> e)
153153
if (e.Row == null) return;
154154
if (e.Row.OrderTotal == 0) return;
155155
RSSVWorkOrderToPay order = e.Row;
156+
// Acuminator disable once PX1042 DatabaseQueriesInRowSelecting [Justification]
156157
var invoices =
157158
SelectFrom<ARInvoice>.
158159
Where<ARInvoice.refNbr.IsEqual<@P.AsString>>.

Customization/T250/CodeSnippets/Activity2.1.1/Step3/RSSVWorkOrderEntry.cs

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,28 @@ public class RSSVWorkOrderEntry : PXGraph<RSSVWorkOrderEntry, RSSVWorkOrder>
1919
public SelectFrom<RSSVWorkOrder>.View WorkOrders = null!;
2020

2121
//The view for the Repair Items tab
22-
public SelectFrom<RSSVWorkOrderItem>.
22+
public
23+
SelectFrom<RSSVWorkOrderItem>.
2324
Where<RSSVWorkOrderItem.orderNbr.
24-
IsEqual<RSSVWorkOrder.orderNbr.FromCurrent>>.View
25-
RepairItems = null!;
25+
IsEqual<RSSVWorkOrder.orderNbr.FromCurrent>>
26+
.View RepairItems = null!;
2627

2728
//The view for the Labor tab
28-
public SelectFrom<RSSVWorkOrderLabor>.
29-
Where<RSSVWorkOrderLabor.orderNbr.
30-
IsEqual<RSSVWorkOrder.orderNbr.FromCurrent>>.View
31-
Labor = null!;
29+
public
30+
SelectFrom<RSSVWorkOrderLabor>.
31+
Where<RSSVWorkOrderLabor.orderNbr.
32+
IsEqual<RSSVWorkOrder.orderNbr.FromCurrent>>
33+
.View Labor = null!;
3234

3335
//The view for the auto-numbering of records
3436
public PXSetup<RSSVSetup> AutoNumSetup = null!;
3537

3638
////////// The added code
37-
public SelectFrom<RSSVWorkOrderPayment>.
38-
Where<RSSVWorkOrderPayment.invoiceNbr.IsEqual<
39-
RSSVWorkOrder.invoiceNbr.FromCurrent>>.
40-
View Payments = null!;
39+
public
40+
SelectFrom<RSSVWorkOrderPayment>.
41+
Where<RSSVWorkOrderPayment.invoiceNbr.
42+
IsEqual<RSSVWorkOrder.invoiceNbr.FromCurrent>>
43+
.View Payments = null!;
4144
////////// The end of added code
4245

4346
#endregion
@@ -67,7 +70,8 @@ protected virtual void _(Events.RowUpdated<RSSVWorkOrder> e)
6770
return;
6871

6972
//Retrieve the default repair items
70-
var repairItems = SelectFrom<RSSVRepairItem>.
73+
var repairItems =
74+
SelectFrom<RSSVRepairItem>.
7175
Where<RSSVRepairItem.serviceID.IsEqual<RSSVWorkOrder.serviceID.FromCurrent>.
7276
And<RSSVRepairItem.deviceID.IsEqual<RSSVWorkOrder.deviceID.FromCurrent>>>
7377
.View.Select(this);
@@ -82,7 +86,8 @@ protected virtual void _(Events.RowUpdated<RSSVWorkOrder> e)
8286
}
8387

8488
//Retrieve the default labor items
85-
var laborItems = SelectFrom<RSSVLabor>.
89+
var laborItems =
90+
SelectFrom<RSSVLabor>.
8691
Where<RSSVLabor.serviceID.IsEqual<RSSVWorkOrder.serviceID.FromCurrent>.
8792
And<RSSVLabor.deviceID.IsEqual<RSSVWorkOrder.deviceID.FromCurrent>>>
8893
.View.Select(this);
@@ -145,7 +150,8 @@ protected virtual void _(Events.FieldVerifying<RSSVWorkOrderLabor,
145150
if (workOrder != null)
146151
{
147152
//Retrieving the default labor item related to the work order labor
148-
RSSVLabor labor = SelectFrom<RSSVLabor>.
153+
RSSVLabor labor =
154+
SelectFrom<RSSVLabor>.
149155
Where<RSSVLabor.serviceID.IsEqual<@P.AsInt>.
150156
And<RSSVLabor.deviceID.IsEqual<@P.AsInt>>.
151157
And<RSSVLabor.inventoryID.IsEqual<@P.AsInt>>>
@@ -176,9 +182,10 @@ protected virtual void _(Events.RowUpdating<RSSVWorkOrder> e)
176182
if (row.Priority == WorkOrderPriorityConstants.Low)
177183
{
178184
//Obtain the service record
179-
RSSVRepairService service = SelectFrom<RSSVRepairService>.
180-
Where<RSSVRepairService.serviceID.IsEqual<@P.AsInt>>.
181-
View.Select(this, row.ServiceID);
185+
RSSVRepairService service =
186+
SelectFrom<RSSVRepairService>.
187+
Where<RSSVRepairService.serviceID.IsEqual<@P.AsInt>>
188+
.View.Select(this, row.ServiceID);
182189

183190
if (service != null && service.PreliminaryCheck == true)
184191
{
Binary file not shown.

0 commit comments

Comments
 (0)