public static AdminRegistrationViewModel Create(IRepository repository, IMajorService majorService, ICeremonyService ceremonyService, IRegistrationService registrationService, TermCode termCode, string userId, string studentid, string lastName, string firstName, string majorCode, int? ceremonyId, string collegeCode)
        {
            Check.Require(repository != null, "Repository is required.");
            Check.Require(majorService != null, "Major service is required.");
            Check.Require(ceremonyService != null, "ceremonyService is required.");

            var ceremonies = ceremonyService.GetCeremonies(userId, termCode);
            var colleges = new List<College>();
            foreach(var a in ceremonies) colleges.AddRange(a.Colleges);

            var viewModel = new AdminRegistrationViewModel()
                                {
                                    MajorCodes = majorService.GetByCeremonies(userId, ceremonies),
                                    Colleges = colleges.Distinct().ToList(),
                                    Ceremonies = ceremonies,
                                    studentidFilter = studentid,
                                    lastNameFilter = lastName,
                                    firstNameFilter = firstName,
                                    majorCodeFilter = majorCode,
                                    ceremonyFilter = ceremonyId ?? -1,
                                    collegeFilter = collegeCode,
                                    Participations = registrationService.GetFilteredParticipationList(userId, studentid, lastName, firstName, majorCode, ceremonyId, collegeCode, ceremonies, termCode)
                                };

            //if (!string.IsNullOrEmpty(majorCode))
            //    viewModel1111 = viewModel.Registrations.Where(a => a.Student.StrMajorCodes.Contains(majorCode));

            return viewModel;
        }
예제 #2
0
 public HeroSheetModel(IPageRenderer pageRenderer, ICoreLogic coreLogic, IConfiguration configuration,
                       ISkillService skillService, IMajorService majorService) : base(pageRenderer, majorService)
 {
     _coreLogic     = coreLogic;
     _configuration = configuration;
     _skillService  = skillService;
 }
예제 #3
0
 public PdfPage(IPageRenderer pageRenderer, IMajorService majorService) : base(majorService)
 {
     _pageRenderer = pageRenderer;
     Converter     = new HtmlToPdfConverter {
         Size = PageSize.A4
     };
 }
예제 #4
0
 public EditModel(IBranchService branchService, IAbilityService abilityService, ICoreLogic coreLogic,
                  ISkillService skillService, IMajorService majorService) : base(majorService)
 {
     _branchService  = branchService;
     _abilityService = abilityService;
     _coreLogic      = coreLogic;
     _skillService   = skillService;
 }
예제 #5
0
 public EditModel(IWeaponService weaponService, IBonusService bonusService, ISkillService skillService,
                  ICoreLogic coreLogic, IMajorService majorService) : base(majorService)
 {
     _weaponService = weaponService;
     _bonusService  = bonusService;
     _skillService  = skillService;
     _coreLogic     = coreLogic;
 }
예제 #6
0
 public EditModel(IRaceService raceService, ICoreLogic coreLogic, IAbilityService abilityService,
                  IBonusService bonusService, IMajorService majorService) : base(majorService)
 {
     _raceService    = raceService;
     _coreLogic      = coreLogic;
     _abilityService = abilityService;
     _bonusService   = bonusService;
 }
예제 #7
0
 public CeremonyController(IRepositoryWithTypedId<TermCode, string> termRepository, IRepositoryWithTypedId<vTermCode, string> vTermRepository, IRepositoryWithTypedId<College, string> collegeRepository, IMajorService majorService, ICeremonyService ceremonyService, IUserService userService)
 {
     _termRepository = termRepository;
     _vTermRepository = vTermRepository;
     _collegeRepository = collegeRepository;
     _majorService = majorService;
     _ceremonyService = ceremonyService;
     _userService = userService;
 }
예제 #8
0
        public static AdminStudentViewModel Create(IRepository repository, IMajorService majorService, ICeremonyService ceremonyService, TermCode termCode, string studentid, string lastName, string firstName, string majorCode, string college, string userId)
        {
            Check.Require(repository != null, "Repository is required.");

            // build a list of majors that the current user has assigned to their ceremonies
            var ceremonies = ceremonyService.GetCeremonies(userId, TermService.GetCurrent());
            var majors = ceremonies.SelectMany(a => a.Majors).Where(a => a.ConsolidationMajor == null && a.IsActive).ToList();
            var colleges = ceremonies.SelectMany(a => a.Colleges).Distinct().ToList();

            var viewModel = new AdminStudentViewModel()
                                {
                                    MajorCodes = majors,
                                    studentidFilter = studentid,
                                    lastNameFilter = lastName,
                                    firstNameFilter = firstName,
                                    majorCodeFilter = majorCode,
                                    Colleges = colleges
                                };

            var query = repository.OfType<Student>().Queryable.Where(a =>
                    a.TermCode == termCode
                    && (a.StudentId.Contains(string.IsNullOrEmpty(studentid) ? string.Empty : studentid.Trim()))
                    && (a.LastName.Contains(string.IsNullOrEmpty(lastName) ? string.Empty : lastName.Trim()))
                    && (a.FirstName.Contains(string.IsNullOrEmpty(firstName) ? string.Empty : firstName.Trim()))
                    );

            // get the list of students with optional filters
            var students = query.ToList();

            if (colleges.Count == 1)
            {
                var coll = colleges.First();
                students = students.Where(a => a.StrColleges.Contains(coll.Id)).ToList();
            }

            if (!string.IsNullOrEmpty(majorCode)) students = students.Where(a => a.StrMajorCodes.Contains(majorCode)).ToList();
            if (!string.IsNullOrEmpty(college)) students = students.Where(a => a.StrColleges.Contains(college)).ToList();

            // get all active registrations
            var reg = repository.OfType<RegistrationParticipation>().Queryable.Where(
                    a => a.Ceremony.TermCode == termCode).// && !a.Registration.Student.SjaBlock && !a.Registration.Cancelled).
                    ToList();

            var regStudents = reg.Select(a => a.Registration.Student);

            viewModel.StudentRegistrationModels = new List<StudentRegistrationModel>();

            foreach(var s in students.Distinct().ToList())
            {
                var reged = regStudents.Any(a => a == s);

                viewModel.StudentRegistrationModels.Add(new StudentRegistrationModel(s, reged));
            }

            return viewModel;
        }
예제 #9
0
 public StudentService(IStudentRepository studentRepository,
                       IGradeService gradeService,
                       IGroupService groupService,
                       IMajorService majorService)
 {
     _studentRepository = studentRepository;
     _gradeService      = gradeService;
     _groupService      = groupService;
     _majorService      = majorService;
 }
예제 #10
0
 public CoreLogic(IMapper mapper, IAbilityService abilityService, IRaceService raceService, 
     IBranchService branchService, ISkillService skillService, ITraitService traitService, IMajorService majorService) : base(mapper)
 {
     _abilityService = abilityService;
     _raceService = raceService;
     _branchService = branchService;
     _skillService = skillService;
     _traitService = traitService;
     _majorService = majorService;
     _encoder = new Encoder();
 }
예제 #11
0
        public static ChangeMajorViewModel Create(IRepository repository, IMajorService majorService, Registration registration, IList<Ceremony> ceremonies)
        {
            Check.Require(repository != null, "Repository is required.");

            var viewModel = new ChangeMajorViewModel()
                                {
                                    MajorCodes = majorService.GetMajors(),
                                    Student = registration.Student,
                                    Registration = registration,
                                    Ceremonies = ceremonies
                                };

            return viewModel;
        }
예제 #12
0
 public AdminController(IRepositoryWithTypedId<Student, Guid> studentRepository, IRepositoryWithTypedId<MajorCode, string> majorRepository, IStudentService studentService, IEmailService emailService, IMajorService majorService, ICeremonyService ceremonyService, IRegistrationService registrationService, IRegistrationPopulator registrationPopulator, IRepository<Registration> registrationRepository, IErrorService errorService, IReportService reportService)
 {
     if (emailService == null) throw new ArgumentNullException("emailService");
     _studentRepository = studentRepository;
     _majorRepository = majorRepository;
     _studentService = studentService;
     _emailService = emailService;
     _majorService = majorService;
     _ceremonyService = ceremonyService;
     _registrationService = registrationService;
     _registrationPopulator = registrationPopulator;
     _registrationRepository = registrationRepository;
     _errorService = errorService;
     _reportService = reportService;
 }
예제 #13
0
 public ReportController(IRepositoryWithTypedId<TermCode, string> termRepository, IUserService userService, ICeremonyService ceremonyService, IMajorService majorService, IRepository<RegistrationParticipation> registrationParticipationRepository)
 {
     _termRepository = termRepository;
     _userService = userService;
     _ceremonyService = ceremonyService;
     _majorService = majorService;
     _registrationParticipationRepository = registrationParticipationRepository;
 }
예제 #14
0
 public IndexModel(IBranchService branchService, IMajorService majorService) : base(majorService)
 {
     _branchService = branchService;
 }
예제 #15
0
 public EditModel(IMagicService magicService, ICoreLogic coreLogic, IMajorService majorService) : base(majorService)
 {
     _magicService = magicService;
     _coreLogic    = coreLogic;
 }
예제 #16
0
 public MajorsController(IMajorService majorService)
 {
     _majorService = majorService;
 }
예제 #17
0
 public IndexModel(IPerkService perkService, IMajorService majorService) : base(majorService)
 {
     _perkService = perkService;
 }
예제 #18
0
 public ResultModel(ICoreLogic coreLogic, IMajorService majorService)
     : base(coreLogic, HeroGenStage.Result, majorService)
 {
 }
예제 #19
0
 public EditModel(IBonusService bonusService, ICoreLogic coreLogic, IBranchService branchService, IMajorService majorService) : base(majorService)
 {
     _bonusService  = bonusService;
     _coreLogic     = coreLogic;
     _branchService = branchService;
 }
예제 #20
0
 public MajorController(IMajorService service) : base(service)
 {
 }
예제 #21
0
 public MajorsController(IMajorService service)
 {
     _service = service;
 }
예제 #22
0
 public MajorController(IMajorService majorService, IMapper mapper, IPasternService pasternService)
 {
     _majorService   = majorService;
     _mapper         = mapper;
     _pasternService = pasternService;
 }
예제 #23
0
 public IndexModel(IMagicService magicService, IMajorService majorService) : base(majorService)
 {
     _magicService = magicService;
 }
예제 #24
0
 public IndexModel(IMajorService majorService) : base(majorService)
 {
 }
예제 #25
0
 public MajorPage(IMajorService majorService)
 {
     MajorService = majorService;
 }
예제 #26
0
 public IndexModel(IRaceService raceService, IMajorService majorService) : base(majorService)
 {
     _raceService = raceService;
 }
예제 #27
0
        public static CeremonyViewModel Create(IRepository repository, IPrincipal user, IMajorService majorService , Ceremony ceremony)
        {
            Check.Require(repository != null, "Repository is required.");
            Check.Require(majorService != null, "Major Service is required.");

            var viewModel = new CeremonyViewModel()
                                {
                                    TermCode = TermService.GetCurrent(),
                                    IsAdmin = user.IsInRole(Role.Codes.Admin),
                                    Ceremony = ceremony,
                                    Surveys = repository.OfType<Survey>().GetAll().ToList()
                                };

            // populate the colleges and majors
            var colleges = repository.OfType<College>().Queryable.Where(a => a.Display).ToList();

            foreach (var clg in colleges)
            {
                if (viewModel.Ceremony.CeremonySurveys.All(a => a.College != clg))
                {
                    var ceremonySurvey = new CeremonySurvey();
                    ceremonySurvey.College = clg;
                    ceremonySurvey.Ceremony = viewModel.Ceremony;
                    viewModel.Ceremony.CeremonySurveys.Add(ceremonySurvey);
                }
            }

            IEnumerable<MajorCode> majors;
            if (ceremony.Id != 0)
            {
                viewModel.Colleges = new MultiSelectList(colleges, "Id", "Name", ceremony.Colleges.Select(x=>x.Id).ToList());
                viewModel.TermCode = ceremony.TermCode;

                majors = majorService.GetByCollege(ceremony.Colleges.ToList());
                viewModel.Majors = new MultiSelectList(majors, "Id", "Name", ceremony.Majors.Select(x => x.Id).ToList());
            }
            else
            {
                viewModel.Colleges = new MultiSelectList(colleges, "Id", "Name");
            }

            // populate the ticket distribution methods
            var tdmethods = repository.OfType<TicketDistributionMethod>().Queryable.Where(a => a.IsActive).ToList();
            var selectedtdmethods = ceremony.TicketDistributionMethods.Select(a => a.Id).ToList();
            viewModel.TicketDistributionMethods = new MultiSelectList(tdmethods, "Id", "Name", selectedtdmethods);

            // info for the time drop downs
            viewModel.Hours = new List<int>();
            viewModel.Minutes = new List<string>();
            viewModel.AmPm = new List<string>();

            for (int i = 1; i < 13; i++)
            {
                viewModel.Hours.Add(i);
            }

            viewModel.Minutes.Add("00");
            viewModel.Minutes.Add("30");

            viewModel.AmPm.Add("AM");
            viewModel.AmPm.Add("PM");

            return viewModel;
        }
예제 #28
0
 public IndexModel(ICoreLogic coreLogic, IMajorService majorService)
     : base(coreLogic, 0, majorService)
 {
 }
예제 #29
0
 public RaceModel(ICoreLogic coreLogic, IRaceService raceService, IMajorService majorService)
     : base(coreLogic, HeroGenStage.Race, majorService)
 {
     _raceService = raceService;
 }
예제 #30
0
 public EditModel(ICreatureService creatureService, IMajorService majorService) : base(majorService)
 {
     _creatureService = creatureService;
 }
예제 #31
0
 public EditModel(IAbilityService abilityService, ICoreLogic coreLogic, IMajorService majorService) : base(majorService)
 {
     _abilityService = abilityService;
     _coreLogic      = coreLogic;
 }
예제 #32
0
 public BookModel(IPageRenderer pageRenderer, IAlchemyService alchemyService, IRaceService raceService, ITraitService traitService, ISkillService skillService,
                  IMagicService magicService, IAbilityService abilityService, IBranchService branchService, IMajorService majorService) :
     base(pageRenderer, majorService)
 {
     _alchemyService = alchemyService;
     _raceService    = raceService;
     _traitService   = traitService;
     _skillService   = skillService;
     _magicService   = magicService;
     _abilityService = abilityService;
     _branchService  = branchService;
 }
예제 #33
0
 public IndexModel(IAbilityService abilityService, IMajorService majorService) : base(majorService)
 {
     _abilityService = abilityService;
 }
예제 #34
0
 public IndexModel(IBonusService bonusService, IMajorService majorService) : base(majorService)
 {
     _bonusService = bonusService;
 }
예제 #35
0
 public IndexModel(IConfiguration configuration, INewsService newsService, IMajorService majorService)
 {
     _configuration = configuration;
     _newsService   = newsService;
     _majorService  = majorService;
 }
예제 #36
0
 public FooterViewComponent(IMajorService majorService)
 {
     _majorService = majorService;
 }
예제 #37
0
 public EditorPage(IMajorService majorService) : base(majorService)
 {
 }