/
WorkOrderRoutingEntity.cs
731 lines (649 loc) · 34.5 KB
/
WorkOrderRoutingEntity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 5.3
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using AdventureWorks.Dal.Adapter.v53;
using AdventureWorks.Dal.Adapter.v53.HelperClasses;
using AdventureWorks.Dal.Adapter.v53.FactoryClasses;
using AdventureWorks.Dal.Adapter.v53.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace AdventureWorks.Dal.Adapter.v53.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// <summary>Entity class which represents the entity 'WorkOrderRouting'.<br/><br/></summary>
[Serializable]
public partial class WorkOrderRoutingEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private LocationEntity _location;
private WorkOrderEntity _workOrder;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Statics
private static Dictionary<string, string> _customProperties;
private static Dictionary<string, Dictionary<string, string>> _fieldsCustomProperties;
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name Location</summary>
public static readonly string Location = "Location";
/// <summary>Member name WorkOrder</summary>
public static readonly string WorkOrder = "WorkOrder";
}
#endregion
/// <summary> Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
static WorkOrderRoutingEntity()
{
SetupCustomPropertyHashtables();
}
/// <summary> CTor</summary>
public WorkOrderRoutingEntity():base("WorkOrderRoutingEntity")
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <remarks>For framework usage.</remarks>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public WorkOrderRoutingEntity(IEntityFields2 fields):base("WorkOrderRoutingEntity")
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this WorkOrderRoutingEntity</param>
public WorkOrderRoutingEntity(IValidator validator):base("WorkOrderRoutingEntity")
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="operationSequence">PK value for WorkOrderRouting which data should be fetched into this WorkOrderRouting object</param>
/// <param name="productId">PK value for WorkOrderRouting which data should be fetched into this WorkOrderRouting object</param>
/// <param name="workOrderId">PK value for WorkOrderRouting which data should be fetched into this WorkOrderRouting object</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public WorkOrderRoutingEntity(System.Int16 operationSequence, System.Int32 productId, System.Int32 workOrderId):base("WorkOrderRoutingEntity")
{
InitClassEmpty(null, null);
this.OperationSequence = operationSequence;
this.ProductId = productId;
this.WorkOrderId = workOrderId;
}
/// <summary> CTor</summary>
/// <param name="operationSequence">PK value for WorkOrderRouting which data should be fetched into this WorkOrderRouting object</param>
/// <param name="productId">PK value for WorkOrderRouting which data should be fetched into this WorkOrderRouting object</param>
/// <param name="workOrderId">PK value for WorkOrderRouting which data should be fetched into this WorkOrderRouting object</param>
/// <param name="validator">The custom validator object for this WorkOrderRoutingEntity</param>
/// <remarks>The entity is not fetched by this constructor. Use a DataAccessAdapter for that.</remarks>
public WorkOrderRoutingEntity(System.Int16 operationSequence, System.Int32 productId, System.Int32 workOrderId, IValidator validator):base("WorkOrderRoutingEntity")
{
InitClassEmpty(validator, null);
this.OperationSequence = operationSequence;
this.ProductId = productId;
this.WorkOrderId = workOrderId;
}
/// <summary> Protected CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected WorkOrderRoutingEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
if(SerializationHelper.Optimization != SerializationOptimization.Fast)
{
_location = (LocationEntity)info.GetValue("_location", typeof(LocationEntity));
if(_location!=null)
{
_location.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_workOrder = (WorkOrderEntity)info.GetValue("_workOrder", typeof(WorkOrderEntity));
if(_workOrder!=null)
{
_workOrder.AfterSave+=new EventHandler(OnEntityAfterSave);
}
this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
}
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
/// <param name="fieldIndex">The fieldindex.</param>
protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
{
switch((WorkOrderRoutingFieldIndex)fieldIndex)
{
case WorkOrderRoutingFieldIndex.LocationId:
DesetupSyncLocation(true, false);
break;
case WorkOrderRoutingFieldIndex.WorkOrderId:
DesetupSyncWorkOrder(true, false);
break;
default:
base.PerformDesyncSetupFKFieldChange(fieldIndex);
break;
}
}
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
/// <param name="propertyName">Name of the property.</param>
/// <param name="entity">Entity to set as an related entity</param>
/// <remarks>Used by prefetch path logic.</remarks>
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
{
switch(propertyName)
{
case "Location":
this.Location = (LocationEntity)entity;
break;
case "WorkOrder":
this.WorkOrder = (WorkOrderEntity)entity;
break;
default:
this.OnSetRelatedEntityProperty(propertyName, entity);
break;
}
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
protected override RelationCollection GetRelationsForFieldOfType(string fieldName)
{
return GetRelationsForField(fieldName);
}
/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
internal static RelationCollection GetRelationsForField(string fieldName)
{
RelationCollection toReturn = new RelationCollection();
switch(fieldName)
{
case "Location":
toReturn.Add(Relations.LocationEntityUsingLocationId);
break;
case "WorkOrder":
toReturn.Add(Relations.WorkOrderEntityUsingWorkOrderId);
break;
default:
break;
}
return toReturn;
}
/// <summary>Checks if the relation mapped by the property with the name specified is a one way / single sided relation. If the passed in name is null, it/ will return true if the entity has any single-sided relation</summary>
/// <param name="propertyName">Name of the property which is mapped onto the relation to check, or null to check if the entity has any relation/ which is single sided</param>
/// <returns>true if the relation is single sided / one way (so the opposite relation isn't present), false otherwise</returns>
protected override bool CheckOneWayRelations(string propertyName)
{
int numberOfOneWayRelations = 0;
switch(propertyName)
{
case null:
return ((numberOfOneWayRelations > 0) || base.CheckOneWayRelations(null));
default:
return base.CheckOneWayRelations(propertyName);
}
}
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName)
{
switch(fieldName)
{
case "Location":
SetupSyncLocation(relatedEntity);
break;
case "WorkOrder":
SetupSyncWorkOrder(relatedEntity);
break;
default:
break;
}
}
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "Location":
DesetupSyncLocation(false, true);
break;
case "WorkOrder":
DesetupSyncWorkOrder(false, true);
break;
default:
break;
}
}
/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These entities will have to be persisted after this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependingRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
return toReturn;
}
/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.</summary>
/// <returns>Collection with 0 or more IEntity2 objects, referenced by this entity</returns>
protected override List<IEntity2> GetDependentRelatedEntities()
{
List<IEntity2> toReturn = new List<IEntity2>();
if(_location!=null)
{
toReturn.Add(_location);
}
if(_workOrder!=null)
{
toReturn.Add(_workOrder);
}
return toReturn;
}
/// <summary>Gets a list of all entity collections stored as member variables in this entity. Only 1:n related collections are returned.</summary>
/// <returns>Collection with 0 or more IEntityCollection2 objects, referenced by this entity</returns>
protected override List<IEntityCollection2> GetMemberEntityCollections()
{
List<IEntityCollection2> toReturn = new List<IEntityCollection2>();
return toReturn;
}
/// <summary>ISerializable member. Does custom serialization so event handlers do not get serialized. Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
/// <param name="info"></param>
/// <param name="context"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (SerializationHelper.Optimization != SerializationOptimization.Fast)
{
info.AddValue("_location", (!this.MarkedForDeletion?_location:null));
info.AddValue("_workOrder", (!this.MarkedForDeletion?_workOrder:null));
}
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
protected override List<IEntityRelation> GetAllRelations()
{
return new WorkOrderRoutingRelations().GetAllRelations();
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'Location' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoLocation()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(LocationFields.LocationId, null, ComparisonOperator.Equal, this.LocationId));
return bucket;
}
/// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'WorkOrder' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoWorkOrder()
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(new FieldCompareValuePredicate(WorkOrderFields.WorkOrderId, null, ComparisonOperator.Equal, this.WorkOrderId));
return bucket;
}
/// <summary>Creates a new instance of the factory related to this entity</summary>
protected override IEntityFactory2 CreateEntityFactory()
{
return EntityFactoryCache2.GetEntityFactory(typeof(WorkOrderRoutingEntityFactory));
}
/// <summary>Adds the member collections to the collections queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void AddToMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.AddToMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Gets the member collections queue from the queue (base first)</summary>
/// <param name="collectionsQueue">The collections queue.</param>
protected override void GetFromMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue)
{
base.GetFromMemberEntityCollectionsQueue(collectionsQueue);
}
/// <summary>Determines whether the entity has populated member collections</summary>
/// <returns>true if the entity has populated member collections.</returns>
protected override bool HasPopulatedMemberEntityCollections()
{
bool toReturn = false;
return toReturn ? true : base.HasPopulatedMemberEntityCollections();
}
/// <summary>Creates the member entity collections queue.</summary>
/// <param name="collectionsQueue">The collections queue.</param>
/// <param name="requiredQueue">The required queue.</param>
protected override void CreateMemberEntityCollectionsQueue(Queue<IEntityCollection2> collectionsQueue, Queue<bool> requiredQueue)
{
base.CreateMemberEntityCollectionsQueue(collectionsQueue, requiredQueue);
}
/// <summary>Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element.</summary>
/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
protected override Dictionary<string, object> GetRelatedData()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
toReturn.Add("Location", _location);
toReturn.Add("WorkOrder", _workOrder);
return toReturn;
}
/// <summary> Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
#region Custom Property Hashtable Setup
/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary<string, string>();
_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, string> fieldHashtable;
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ActualCost", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ActualEndDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ActualResourceHrs", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ActualStartDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("LocationId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ModifiedDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("OperationSequence", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("PlannedCost", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ProductId", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ScheduledEndDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("ScheduledStartDate", fieldHashtable);
fieldHashtable = new Dictionary<string, string>();
_fieldsCustomProperties.Add("WorkOrderId", fieldHashtable);
}
#endregion
/// <summary> Removes the sync logic for member _location</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncLocation(bool signalRelatedEntity, bool resetFKFields)
{
DesetupSync(signalRelatedEntity, resetFKFields, ref _location, new PropertyChangedEventHandler(OnLocationPropertyChanged), "Location", "WorkOrderRoutings", AdventureWorks.Dal.Adapter.v53.RelationClasses.StaticWorkOrderRoutingRelations.LocationEntityUsingLocationIdStatic, true, new int[] { (int)WorkOrderRoutingFieldIndex.LocationId });
}
/// <summary> setups the sync logic for member _location</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncLocation(IEntityCore relatedEntity)
{
SetupSync(relatedEntity, ref _location, new PropertyChangedEventHandler( OnLocationPropertyChanged ), "Location", "WorkOrderRoutings", AdventureWorks.Dal.Adapter.v53.RelationClasses.StaticWorkOrderRoutingRelations.LocationEntityUsingLocationIdStatic, true, new string[] { }, new int[] { (int)WorkOrderRoutingFieldIndex.LocationId });
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnLocationPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Removes the sync logic for member _workOrder</summary>
/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
private void DesetupSyncWorkOrder(bool signalRelatedEntity, bool resetFKFields)
{
DesetupSync(signalRelatedEntity, resetFKFields, ref _workOrder, new PropertyChangedEventHandler(OnWorkOrderPropertyChanged), "WorkOrder", "WorkOrderRoutings", AdventureWorks.Dal.Adapter.v53.RelationClasses.StaticWorkOrderRoutingRelations.WorkOrderEntityUsingWorkOrderIdStatic, true, new int[] { (int)WorkOrderRoutingFieldIndex.WorkOrderId });
}
/// <summary> setups the sync logic for member _workOrder</summary>
/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
private void SetupSyncWorkOrder(IEntityCore relatedEntity)
{
SetupSync(relatedEntity, ref _workOrder, new PropertyChangedEventHandler( OnWorkOrderPropertyChanged ), "WorkOrder", "WorkOrderRoutings", AdventureWorks.Dal.Adapter.v53.RelationClasses.StaticWorkOrderRoutingRelations.WorkOrderEntityUsingWorkOrderIdStatic, true, new string[] { }, new int[] { (int)WorkOrderRoutingFieldIndex.WorkOrderId });
}
/// <summary>Handles property change events of properties in a related entity.</summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnWorkOrderPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this WorkOrderRoutingEntity</param>
/// <param name="fields">Fields of this entity</param>
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
#region Class Property Declarations
/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
public static WorkOrderRoutingRelations Relations
{
get { return new WorkOrderRoutingRelations(); }
}
/// <summary> The custom properties for this entity type.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, string> CustomProperties
{
get { return _customProperties;}
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'Location' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathLocation
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(LocationEntityFactory))), (IEntityRelation)GetRelationsForField("Location")[0], (int)AdventureWorks.Dal.Adapter.v53.EntityType.WorkOrderRoutingEntity, (int)AdventureWorks.Dal.Adapter.v53.EntityType.LocationEntity, 0, null, null, null, null, "Location", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'WorkOrder' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathWorkOrder
{
get { return new PrefetchPathElement2(new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(WorkOrderEntityFactory))), (IEntityRelation)GetRelationsForField("WorkOrder")[0], (int)AdventureWorks.Dal.Adapter.v53.EntityType.WorkOrderRoutingEntity, (int)AdventureWorks.Dal.Adapter.v53.EntityType.WorkOrderEntity, 0, null, null, null, null, "WorkOrder", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne); }
}
/// <summary> The custom properties for the type of this entity instance.</summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, string> CustomPropertiesOfType
{
get { return CustomProperties;}
}
/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
public static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
[Browsable(false), XmlIgnore]
protected override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
{
get { return FieldsCustomProperties;}
}
/// <summary> The ActualCost property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ActualCost"<br/>
/// Table field type characteristics (type, precision, scale, length): Money, 19, 4, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Decimal> ActualCost
{
get { return (Nullable<System.Decimal>)GetValue((int)WorkOrderRoutingFieldIndex.ActualCost, false); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ActualCost, value); }
}
/// <summary> The ActualEndDate property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ActualEndDate"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ActualEndDate
{
get { return (Nullable<System.DateTime>)GetValue((int)WorkOrderRoutingFieldIndex.ActualEndDate, false); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ActualEndDate, value); }
}
/// <summary> The ActualResourceHrs property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ActualResourceHrs"<br/>
/// Table field type characteristics (type, precision, scale, length): Decimal, 9, 4, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Decimal> ActualResourceHrs
{
get { return (Nullable<System.Decimal>)GetValue((int)WorkOrderRoutingFieldIndex.ActualResourceHrs, false); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ActualResourceHrs, value); }
}
/// <summary> The ActualStartDate property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ActualStartDate"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.DateTime> ActualStartDate
{
get { return (Nullable<System.DateTime>)GetValue((int)WorkOrderRoutingFieldIndex.ActualStartDate, false); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ActualStartDate, value); }
}
/// <summary> The LocationId property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."LocationID"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Int16 LocationId
{
get { return (System.Int16)GetValue((int)WorkOrderRoutingFieldIndex.LocationId, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.LocationId, value); }
}
/// <summary> The ModifiedDate property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ModifiedDate"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.DateTime ModifiedDate
{
get { return (System.DateTime)GetValue((int)WorkOrderRoutingFieldIndex.ModifiedDate, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ModifiedDate, value); }
}
/// <summary> The OperationSequence property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."OperationSequence"<br/>
/// Table field type characteristics (type, precision, scale, length): SmallInt, 5, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.Int16 OperationSequence
{
get { return (System.Int16)GetValue((int)WorkOrderRoutingFieldIndex.OperationSequence, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.OperationSequence, value); }
}
/// <summary> The PlannedCost property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."PlannedCost"<br/>
/// Table field type characteristics (type, precision, scale, length): Money, 19, 4, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.Decimal PlannedCost
{
get { return (System.Decimal)GetValue((int)WorkOrderRoutingFieldIndex.PlannedCost, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.PlannedCost, value); }
}
/// <summary> The ProductId property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ProductID"<br/>
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.Int32 ProductId
{
get { return (System.Int32)GetValue((int)WorkOrderRoutingFieldIndex.ProductId, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ProductId, value); }
}
/// <summary> The ScheduledEndDate property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ScheduledEndDate"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.DateTime ScheduledEndDate
{
get { return (System.DateTime)GetValue((int)WorkOrderRoutingFieldIndex.ScheduledEndDate, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ScheduledEndDate, value); }
}
/// <summary> The ScheduledStartDate property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."ScheduledStartDate"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.DateTime ScheduledStartDate
{
get { return (System.DateTime)GetValue((int)WorkOrderRoutingFieldIndex.ScheduledStartDate, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.ScheduledStartDate, value); }
}
/// <summary> The WorkOrderId property of the Entity WorkOrderRouting<br/><br/></summary>
/// <remarks>Mapped on table field: "WorkOrderRouting"."WorkOrderID"<br/>
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.Int32 WorkOrderId
{
get { return (System.Int32)GetValue((int)WorkOrderRoutingFieldIndex.WorkOrderId, true); }
set { SetValue((int)WorkOrderRoutingFieldIndex.WorkOrderId, value); }
}
/// <summary> Gets / sets related entity of type 'LocationEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual LocationEntity Location
{
get { return _location; }
set
{
if(this.IsDeserializing)
{
SetupSyncLocation(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "WorkOrderRoutings", "Location", _location, true);
}
}
}
/// <summary> Gets / sets related entity of type 'WorkOrderEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..<br/><br/></summary>
[Browsable(false)]
public virtual WorkOrderEntity WorkOrder
{
get { return _workOrder; }
set
{
if(this.IsDeserializing)
{
SetupSyncWorkOrder(value);
}
else
{
SetSingleRelatedEntityNavigator(value, "WorkOrderRoutings", "WorkOrder", _workOrder, true);
}
}
}
/// <summary> Gets the type of the hierarchy this entity is in. </summary>
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// <summary>Returns the AdventureWorks.Dal.Adapter.v53.EntityType enum value for this entity.</summary>
[Browsable(false), XmlIgnore]
protected override int LLBLGenProEntityTypeValue
{
get { return (int)AdventureWorks.Dal.Adapter.v53.EntityType.WorkOrderRoutingEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}