public AssessmentDetail CreateNewAssessment(int currentUserId) { DateTime nowUTC = Utilities.UtcToLocal(DateTime.UtcNow); AssessmentDetail newAssessment = new AssessmentDetail { AssessmentName = "New Assessment", AssessmentDate = nowUTC, CreatorId = currentUserId, CreatedDate = nowUTC, LastModifiedDate = nowUTC }; // Commit the new assessment int assessment_id = SaveAssessmentDetail(0, newAssessment); newAssessment.Id = assessment_id; // Add the current user to the new assessment as an admin that has already been 'invited' ContactsManager contactManager = new ContactsManager(); contactManager.AddContactToAssessment(assessment_id, currentUserId, Constants.AssessmentAdminId, true); new SalManager().SetDefaultSALs(assessment_id); new StandardsManager().PersistSelectedStandards(assessment_id, null); CreateIrpHeaders(assessment_id); return(newAssessment); }
public AssessmentDetail CreateNewAssessmentForImport(int currentUserId) { DateTime nowUTC = DateTime.Now; AssessmentDetail newAssessment = new AssessmentDetail { AssessmentName = "New Assessment", AssessmentDate = nowUTC, CreatorId = currentUserId, CreatedDate = nowUTC, LastModifiedDate = nowUTC }; // Commit the new assessment int assessment_id = SaveAssessmentDetail(0, newAssessment); newAssessment.Id = assessment_id; // Add the current user to the new assessment as an admin that has already been 'invited' ContactsManager contactManager = new ContactsManager(); contactManager.AddContactToAssessment(assessment_id, currentUserId, Constants.AssessmentAdminId, true); return(newAssessment); }