Example #1
0
        /// <summary>
        /// Display the specified Meeting.
        /// </summary>
        /// <param name="meetingId">Meeting Id.</param>
        /// <returns>View.</returns>
        public async Task <IActionResult> Index(Guid meetingId)
        {
            IWho who = this.Who();

            this.logger.ReportEntry(
                who,
                new { MeetingId = meetingId });

            IMeeting meeting = await this.service
                               .GetMeetingByIdAsync(
                who : who,
                meetingId : meetingId)
                               .ConfigureAwait(false);

            IndexViewModel model = IndexViewModel.Create(meeting);

            ViewResult view = this.View(model);

            this.logger.ReportExitView(
                who,
                view.ViewName,
                view.Model,
                view.StatusCode);

            return(view);
        }
Example #2
0
        /// <summary>
        /// Display committees for the specified organisation.
        /// </summary>
        /// <param name="organisationId">The organisation identifier.</param>
        /// <returns>View.</returns>
        public async Task <IActionResult> Index(Guid organisationId)
        {
            IWho who = this.Who();

            this.logger.ReportEntry(
                who,
                new { OrganisationId = organisationId });

            IOrganisationWithCommittees organisation = await this.service
                                                       .GetOrganisationByIdWithCommitteesAsync(
                who : who,
                organisationId : organisationId)
                                                       .ConfigureAwait(false);

            IndexViewModel model = IndexViewModel.Create(organisation);

            ViewResult view = this.View(model);

            this.logger.ReportExitView(
                who,
                view.ViewName,
                view.Model,
                view.StatusCode);

            return(view);
        }
        /// <summary>
        /// Display meetings for the specified committee.
        /// </summary>
        /// <param name="committeeId">CommitteeId.</param>
        /// <returns>View.</returns>
        public async Task <IActionResult> Index(Guid committeeId)
        {
            IWho who = this.Who();

            this.logger.ReportEntry(
                who,
                new { CommitteeId = committeeId });

            ICommitteeWithMeetings committee = await this.service
                                               .GetCommitteeByIdWithMeetingsAsync(
                who : who,
                committeeId : committeeId)
                                               .ConfigureAwait(false);

            IndexViewModel model = IndexViewModel.Create(committee);

            ViewResult view = this.View(model);

            this.logger.ReportExitView(
                who,
                view.ViewName,
                view.Model,
                view.StatusCode);

            return(view);
        }
Example #4
0
        public async Task <IActionResult> Index()
        {
            IWho who = this.Who();

            this.logger.ReportEntry(who);

            IList <IMeeting> meetings = await this.service
                                        .GetRecentMeetingsMostRecentFirstAsync(who)
                                        .ConfigureAwait(false);

            ISetupStatus setupStatus = meetings.Any()
                ? new SetupStatus(haveOrganisations: true, haveCommittees: true)
                : await this.service
                                       .GetSetupStatusAsync(who)
                                       .ConfigureAwait(false);

            bool featureEnabled = await this.featureManager
                                  .IsEnabledAsync(nameof(FeatureFlag.NewReferenceSearch))
                                  .ConfigureAwait(false);

            IndexViewModel model = IndexViewModel.Create(meetings, setupStatus, featureEnabled);

            ViewResult view = this.View(model);

            this.logger.ReportExitView(
                who,
                view.ViewName,
                view.Model,
                view.StatusCode);

            return(view);
        }
        public async Task <IActionResult> Index(CancellationToken cancellationToken)
        {
            var orders = await OrderService.GetAll(cancellationToken);

            var providers = await ProviderService.GetAll(cancellationToken);

            var orderItems = await OrderItemsService.GetAll(cancellationToken);

            var model = IndexViewModel.Create(orders, orders, providers, orderItems);

            return(base.View(model));
        }
        /// <summary>
        /// Display all Organisations.
        /// </summary>
        /// <returns>View.</returns>
        public async Task <IActionResult> Index()
        {
            IWho who = this.Who();

            this.logger.ReportEntry(who);

            IList <IOrganisation> organisations = (await this.service
                                                   .GetAllOrganisationsAsync(who)
                                                   .ConfigureAwait(false))
                                                  .OrderBy(o => o.Code)
                                                  .ToList();

            IndexViewModel model = IndexViewModel.Create(organisations);

            ViewResult view = this.View(model);

            this.logger.ReportExitView(
                who,
                view.ViewName,
                view.Model,
                view.StatusCode);

            return(view);
        }
Example #7
0
 public IActionResult Index(string message)
 {
     return(View(IndexViewModel.Create(this.PayrollService, message)));
 }