Пример #1
0
 /// <summary>
 /// Enum types are equal by primary key
 /// </summary>
 public bool Equals(FieldVisitStatus other)
 {
     if (other == null)
     {
         return(false);
     }
     return(other.FieldVisitStatusID == FieldVisitStatusID);
 }
Пример #2
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public FieldVisit(TreatmentBMP treatmentBMP, FieldVisitStatus fieldVisitStatus, Person performedByPerson, DateTime visitDate, bool inventoryUpdated, FieldVisitType fieldVisitType, bool isFieldVisitVerified) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.FieldVisitID   = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.TreatmentBMPID = treatmentBMP.TreatmentBMPID;
     this.TreatmentBMP   = treatmentBMP;
     treatmentBMP.FieldVisits.Add(this);
     this.FieldVisitStatusID  = fieldVisitStatus.FieldVisitStatusID;
     this.PerformedByPersonID = performedByPerson.PersonID;
     this.PerformedByPerson   = performedByPerson;
     performedByPerson.FieldVisitsWhereYouAreThePerformedByPerson.Add(this);
     this.VisitDate            = visitDate;
     this.InventoryUpdated     = inventoryUpdated;
     this.FieldVisitTypeID     = fieldVisitType.FieldVisitTypeID;
     this.IsFieldVisitVerified = isFieldVisitVerified;
 }
Пример #3
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static FieldVisit CreateNewBlank(TreatmentBMP treatmentBMP, FieldVisitStatus fieldVisitStatus, Person performedByPerson, FieldVisitType fieldVisitType)
 {
     return(new FieldVisit(treatmentBMP, fieldVisitStatus, performedByPerson, default(DateTime), default(bool), fieldVisitType, default(bool)));
 }