public override void Seed() { var establishment = _entities.Get<Establishment>().SingleOrDefault(x => x.OfficialName == "University of Cincinnati"); if (establishment == null) throw new Exception("Establishment is null"); CreatedEmployeeModuleSettings = Seed(new CreateEmployeeModuleSettings { EmployeeFacultyRanks = new Collection<EmployeeFacultyRank> { /* TODO: Need actual UC ranks here. */ new EmployeeFacultyRank {Rank = "Assistant Professor"}, new EmployeeFacultyRank {Rank = "Associate Professor"}, new EmployeeFacultyRank {Rank = "Professor"}, new EmployeeFacultyRank {Rank = "Distinquished University Professor"}, new EmployeeFacultyRank {Rank = "Other"}, }, NotifyAdminOnUpdate = false, PersonalInfoAnchorText = null, //"My International", EstablishmentId = establishment.RevisionId, /* TODO: Need actual UC activity types here. */ EmployeeActivityTypes = new Collection<EmployeeActivityType> { new EmployeeActivityType {Type = "Research or Creative Endeavor", Rank = 1}, new EmployeeActivityType {Type = "Teaching or Mentoring", Rank = 2}, new EmployeeActivityType {Type = "Award or Honor", Rank = 3}, new EmployeeActivityType {Type = "Conference Presentation or Proceeding", Rank = 4}, new EmployeeActivityType {Type = "Professional Development, Service or Consulting", Rank = 5} } }); }
public int?Handle(ReportDefaultYearRangeByEstablishmentId query) { if (query == null) { throw new ArgumentNullException("query"); } int?range = null; EmployeeModuleSettings settings = _entities.Query <EmployeeModuleSettings>() .SingleOrDefault(p => p.Establishment.RevisionId == query.EstablishmentId); if (settings != null) { range = settings.ReportsDefaultYearRange; } return(range); }
public void Handle(CreateEmployeeModuleSettings command) { if (command == null) { throw new ArgumentNullException("command"); } var employeeModuleSettings = new EmployeeModuleSettings { FacultyRanks = command.EmployeeFacultyRanks, NotifyAdminOnUpdate = command.NotifyAdminOnUpdate, NotifyAdmins = new[] { _entities.Get <Person>().SingleOrDefault(x => x.RevisionId == command.NotifyAdminPersonId) }, PersonalInfoAnchorText = command.PersonalInfoAnchorText, Establishment = _entities.Get <Establishment>().SingleOrDefault(x => x.RevisionId == command.EstablishmentId), ActivityTypes = command.EmployeeActivityTypes, OfferCountry = command.OfferCountry, OfferActivityType = command.OfferActivityType, OfferFundingQuestions = command.OfferFundingQuestions, InternationalPedigreeTitle = command.InternationalPedigreeTitle, ReportsDefaultYearRange = command.ReportsDefaultYearRange, GlobalViewIconLength = command.GlobalViewIconLength, GlobalViewIconMimeType = command.GlobalViewIconMimeType, GlobalViewIconName = command.GlobalViewIconName, GlobalViewIconPath = command.GlobalViewIconPath, GlobalViewIconFileName = command.GlobalViewIconFileName, FindAnExpertIconLength = command.FindAnExpertIconLength, FindAnExpertIconMimeType = command.FindAnExpertIconMimeType, FindAnExpertIconName = command.FindAnExpertIconName, FindAnExpertIconPath = command.FindAnExpertIconPath, FindAnExpertIconFileName = command.FindAnExpertIconFileName }; _entities.Create(employeeModuleSettings); _unitOfWork.SaveChanges(); command.CreatedEmployeeModuleSettings = employeeModuleSettings; }
public override void Seed() { var establishment = _entities.Get<Establishment>().SingleOrDefault(x => x.OfficialName == "University of South Florida"); if (establishment == null) throw new Exception("Establishment is null"); CreatedEmployeeModuleSettings = Seed(new CreateEmployeeModuleSettings { EmployeeFacultyRanks = new Collection<EmployeeFacultyRank> { new EmployeeFacultyRank {Rank = "Assistant Professor"}, new EmployeeFacultyRank {Rank = "Associate Professor"}, new EmployeeFacultyRank {Rank = "Professor"}, new EmployeeFacultyRank {Rank = "Distinquished University Professor"}, new EmployeeFacultyRank {Rank = "Other"}, }, NotifyAdminOnUpdate = false, PersonalInfoAnchorText = "My USF World Profile", EstablishmentId = establishment.RevisionId, EmployeeActivityTypes = new Collection<EmployeeActivityType> { new EmployeeActivityType {Type = "Research or Creative Endeavor", Rank = 1}, new EmployeeActivityType {Type = "Teaching or Mentoring", Rank = 2}, new EmployeeActivityType {Type = "Award or Honor", Rank = 3}, new EmployeeActivityType {Type = "Conference Presentation or Proceeding", Rank = 4}, new EmployeeActivityType {Type = "Professional Development, Service or Consulting", Rank = 5} }, OfferCountry = true, OfferActivityTypes = true, OfferFundingQuestions = true, InternationalPedigreeTitle = "My Formal Education Outside the US" }); }