Ejemplo n.º 1
0
        public async Task AfterWhichCampus(IDialogContext context, IAwaitable <CampusOptions> result)
        {
            CampusOptions response = await result;

            WhichCampus = response;
            if (response.ToString().ToLower() == "offcampus")
            {
                await context.PostAsync("To remotely connect to the UMMS network to access the CMS," +
                                        $"you will need to connect through a Virtual Private Network or VPN. The easiest way to do this is to go to https://remote.umassmed.edu. ");

                PromptDialog.Choice(
                    context: context,
                    resume: AfterFurtherAssistance,
                    prompt: "Do you still require help with this issue? ",
                    options: (IEnumerable <YesOrNo>)Enum.GetValues(typeof(YesOrNo)),
                    retry: "Please select one of the choices.",
                    promptStyle: PromptStyle.Auto
                    );
            }
            else
            {
                PromptDialog.Choice(
                    context: context,
                    resume: AfterConnectionOptions,
                    prompt: "Are you on connected to lan cable or wireless? ",
                    options: (IEnumerable <ConnectionOptions>)Enum.GetValues(typeof(ConnectionOptions)),
                    retry: "Please select one of the choices.",
                    promptStyle: PromptStyle.Auto
                    );
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the campuses that can be sent to a client.
        /// </summary>
        /// <param name="options">The options that specify which campuses to include.</param>
        /// <returns>A list of <see cref="ListItemViewModel"/> that represent the campus values.</returns>
        public List <ListItemViewModel> GetCampusesAsListItems(CampusOptions options = null)
        {
            IEnumerable <CampusCache> source = CampusCache.All(RockContext);

            options = options ?? DefaultCampusOptions;

            // Exclude inactive campuses unless we were asked to include them.
            if (!options.IncludeInactive)
            {
                source = source.Where(c => c.IsActive == true);
            }

            // If they specified any campus types then limit the results to
            // only those campuses that fit the criteria.
            if (options.LimitCampusTypes != null && options.LimitCampusTypes.Count > 0)
            {
                source = source.Where(c =>
                {
                    if (!c.CampusTypeValueId.HasValue)
                    {
                        return(false);
                    }

                    var definedValueCache = DefinedValueCache.Get(c.CampusTypeValueId.Value);

                    return(definedValueCache != null && options.LimitCampusTypes.Contains(definedValueCache.Guid));
                });
            }

            // If they specified any campus status then limit the results to
            // only those campuses that fit the criteria.
            if (options.LimitCampusStatuses != null && options.LimitCampusStatuses.Count > 0)
            {
                source = source.Where(c =>
                {
                    if (!c.CampusStatusValueId.HasValue)
                    {
                        return(false);
                    }

                    var definedValueCache = DefinedValueCache.Get(c.CampusStatusValueId.Value);

                    return(definedValueCache != null && options.LimitCampusStatuses.Contains(definedValueCache.Guid));
                });
            }

            source = CheckSecurity(source);

            return(source.OrderBy(c => c.Order)
                   .Select(c => new ListItemViewModel()
            {
                Value = c.Guid.ToString(),
                Text = c.Name
            }).ToList());
        }
 public DefaultDateLogicService(IOptions <CampusOptions> optionsAccessor)
 {
     _campusOptions = optionsAccessor.Value;
 }