コード例 #1
0
 /// <summary>
 /// Enum types are equal by primary key
 /// </summary>
 public bool Equals(ActionItemState other)
 {
     if (other == null)
     {
         return(false);
     }
     return(other.ActionItemStateID == ActionItemStateID);
 }
コード例 #2
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public ActionItem(ActionItemState actionItemState, Person assignedToPerson, DateTime assignedOnDate, DateTime dueByDate, Project project) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.ActionItemID       = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.ActionItemStateID  = actionItemState.ActionItemStateID;
     this.AssignedToPersonID = assignedToPerson.PersonID;
     this.AssignedToPerson   = assignedToPerson;
     assignedToPerson.ActionItemsWhereYouAreTheAssignedToPerson.Add(this);
     this.AssignedOnDate = assignedOnDate;
     this.DueByDate      = dueByDate;
     this.ProjectID      = project.ProjectID;
     this.Project        = project;
     project.ActionItems.Add(this);
 }
コード例 #3
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static ActionItem CreateNewBlank(ActionItemState actionItemState, Person assignedToPerson, Project project)
 {
     return(new ActionItem(actionItemState, assignedToPerson, default(DateTime), default(DateTime), project));
 }