public void UpdateModel(ProjectFirmaModels.Models.ContactRelationshipType contactRelationshipType)
        {
            contactRelationshipType.ContactRelationshipTypeName = ContactRelationshipTypeName;
            contactRelationshipType.ContactRelationshipTypeAcceptsMultipleValues = ContactRelationshipTypeAcceptsMultipleValues;

            contactRelationshipType.IsContactRelationshipTypeRequired = IsContactRelationshipTypeRequired ?? false;
            contactRelationshipType.IsContactRelationshipRequiredMinimumProjectStageID = IsContactRelationshipRequiredMinimumProjectStageID;
            contactRelationshipType.ContactRelationshipTypeDescription = ContactRelationshipTypeDescription;
            contactRelationshipType.CanManageProject = CanManageProject ?? false;
        }
 public EditContactRelationshipTypeViewModel(ProjectFirmaModels.Models.ContactRelationshipType contactRelationshipType)
 {
     RelationshipTypeID          = contactRelationshipType.ContactRelationshipTypeID;
     ContactRelationshipTypeName = contactRelationshipType.ContactRelationshipTypeName;
     ContactRelationshipTypeAcceptsMultipleValues       = contactRelationshipType.ContactRelationshipTypeAcceptsMultipleValues;
     IsContactRelationshipTypeRequired                  = contactRelationshipType.IsContactRelationshipTypeRequired;
     IsContactRelationshipRequiredMinimumProjectStageID = contactRelationshipType.IsContactRelationshipRequiredMinimumProjectStageID;
     ContactRelationshipTypeDescription                 = contactRelationshipType.ContactRelationshipTypeDescription;
     CanManageProject = contactRelationshipType.CanManageProject;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public ProjectContact(Project project, Person contact, ContactRelationshipType contactRelationshipType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.ProjectContactID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.ProjectID        = project.ProjectID;
     this.Project          = project;
     project.ProjectContacts.Add(this);
     this.ContactID = contact.PersonID;
     this.Contact   = contact;
     contact.ProjectContactsWhereYouAreTheContact.Add(this);
     this.ContactRelationshipTypeID = contactRelationshipType.ContactRelationshipTypeID;
     this.ContactRelationshipType   = contactRelationshipType;
     contactRelationshipType.ProjectContacts.Add(this);
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static ProjectContactUpdate CreateNewBlank(ProjectUpdateBatch projectUpdateBatch, Person contact, ContactRelationshipType contactRelationshipType)
 {
     return new ProjectContactUpdate(projectUpdateBatch, contact, contactRelationshipType);
 }
Exemplo n.º 5
0
        public static string GetRequiredRelationshipTypeErrorStringSuffix(ProjectStage currentProjectStage, ProjectFirmaModels.Models.ContactRelationshipType contactRelationshipType)
        {
            bool hasMinimumProjectStageSet = contactRelationshipType.IsContactRelationshipRequiredMinimumProjectStage != null;

            if (hasMinimumProjectStageSet && currentProjectStage.SortOrder >= contactRelationshipType.IsContactRelationshipRequiredMinimumProjectStage.SortOrder)
            {
                return($"Project Stage is at or beyond {contactRelationshipType.IsContactRelationshipRequiredMinimumProjectStage.ProjectStageDisplayName}, when the {contactRelationshipType.ContactRelationshipTypeName} must be set.");
            }

            return(string.Empty);
        }
Exemplo n.º 6
0
 public static string GetDeleteUrl(this ContactRelationshipType contactRelationshipType)
 {
     return(SitkaRoute <ContactRelationshipTypeController> .BuildUrlFromExpression(c =>
                                                                                   c.DeleteContactRelationshipType(contactRelationshipType.ContactRelationshipTypeID)));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static ProjectContact CreateNewBlank(Project project, Person contact, ContactRelationshipType contactRelationshipType)
 {
     return(new ProjectContact(project, contact, contactRelationshipType));
 }