private Notification BuildNewNotification(InstructorApplication instructorApplication, Student thisUser) { var newNotification = new Notification { Time = DateTime.Now, Details = "A user by the name of " + thisUser.FirstMidName + " " + thisUser.LastName + " has applied to become an Instructor", Link = Url.Action( "Details", "InstructorApplication", new {id = instructorApplication.InstructorApplicationID}), ViewableBy = "Admin", Complete = false }; return newNotification; }
private void BuildNewNotificationAndAddToDb(InstructorApplication instructorApplication, Student thisUser) { Notification newNotification = BuildNewNotification(instructorApplication, thisUser); db.Notification.Add(newNotification); }
private static InstructorApplication BuildNewInstructorApplication( InstructorApplicationViewModel applicationFromView, Student thisUser) { var educationList = new List<EducationalBackground>(); foreach (EducationalBackGround educate in applicationFromView.EducationalBackgrounds) { var education = new EducationalBackground { YearReceived = educate.YearReceived, Degree = educate.Degree, AreaOfStudy = educate.AreaOfStudy, UniversityOrCollege = educate.UniversityOrCollege }; educationList.Add(education); } var instructorApplication = new InstructorApplication { StudentID = thisUser.StudentID, EducationalBackground = new List<EducationalBackground>(), Experience = applicationFromView.Experience, WillingToTravel = applicationFromView.WillingToTravel, Approved = false }; instructorApplication.EducationalBackground.AddRange(educationList); return instructorApplication; }