Task IModelBinder.BindModelAsync(ModelBindingContext bindingContext) { var stepTypeValue = bindingContext.ValueProvider.GetValue("StepType"); var stepType = Type.GetType(stepTypeValue.ToString()); RequestHelpFormVariant requestHelpFormVariant = Enum.Parse <RequestHelpFormVariant>(bindingContext.ValueProvider.GetValue("FormVariant").FirstValue); int.TryParse(bindingContext.ValueProvider.GetValue("ReferringGroupId").FirstValue, out int groupId); Enum.TryParse <SupportActivities>(bindingContext.ValueProvider.GetValue("SelectedSupportActivity").FirstValue, out SupportActivities selectedSupportActivity); bindingContext.ModelMetadata = _provider.GetMetadataForType(stepType); switch (stepType.Name) { case nameof(RequestHelpRequestStageViewModel): bindingContext.Result = ModelBindingResult.Success(BindRequestStage(bindingContext, requestHelpFormVariant, groupId).Result); break; case nameof(RequestHelpDetailStageViewModel): bindingContext.Result = ModelBindingResult.Success(BindDetailStage(bindingContext, requestHelpFormVariant, selectedSupportActivity, groupId).Result); break; case nameof(RequestHelpReviewStageViewModel): bindingContext.Result = ModelBindingResult.Success(BindReviewStage(bindingContext)); break; } return(Task.CompletedTask); }
public IActionResult Success(Fulfillable fulfillable, RequestHelpFormVariant requestHelpFormVariant, string referringGroup, string source) { source = ValidateSource(source); string button; string message = requestHelpFormVariant switch { RequestHelpFormVariant.FtLOS => @"<p>Your request has been received and we are looking for a volunteer who can help. Someone should get in touch shortly.</p> <p>For the Love of Scrubs ask for a small donation of £3 - £4 per face covering to cover the cost of materials and help support their communities. Without donations they aren’t able to continue their good work.</p> <p>If you are able to donate, you can do so on their Go Fund Me page <a href='https://www.gofundme.com/f/for-the-love-of-scrubs-face-coverings\' target=\'_blank\'>here</a>.<p>", RequestHelpFormVariant.Ruddington => @"<p>Your request has been received and we're looking for a volunteer who can help, as soon as we find someone we’ll let you know by email. Please be aware that we cannot guarantee help, but we’ll do our best to find a volunteer near you.</p>", _ => @"<p>Your request has been received and we are looking for a volunteer who can help. Someone should get in touch shortly.</p>" }; if (User.Identity.IsAuthenticated) { button = $"<a href='/account' class='btn cta large fill mt16 cta--orange'>Done</a>"; } else { message += "<p><strong>Would you be happy to help a neighbour?</strong></p>"; message += "<p>Could you help a member of your local community if they needed something? There are lots of different ways you can help, from offering a friendly chat, to picking up groceries or prescriptions, or even sewing a face covering. Please take 5 minutes to sign up now.</p>"; button = $"<a href='/login' class='btn cta large fill mt16 '>Sign Up or Log In</a>"; } List <NotificationModel> notifications = new List <NotificationModel> { new NotificationModel { Title = "Thank you", Subtitle = "Your request has been received", Type = Enums.Account.NotificationType.Success, Message = message, Button = button } }; SuccessViewModel vm = new SuccessViewModel { Notifications = notifications, RequestLink = $"/request-help/{referringGroup}/{source}" }; return(View(vm)); }
private string GetHelpRequestPageTitle(RequestHelpFormVariant requestHelpFormVariant) { return(requestHelpFormVariant switch { RequestHelpFormVariant.FtLOS => "How can For the Love of Scrubs help?", RequestHelpFormVariant.Ruddington => "Request help from Ruddington Community Response Team", RequestHelpFormVariant.AgeUKNottsBalderton => "Request help from Balderton Community Support", RequestHelpFormVariant.AgeUKNottsNorthMuskham => "Request help from North Muskham Community Support", RequestHelpFormVariant.AgeUKSouthKentCoast_Public => "Request Help from Age UK South Kent Coast", RequestHelpFormVariant.AgeUKSouthKentCoast_RequestSubmitter => "Request Help from Age UK South Kent Coast", RequestHelpFormVariant.AgeUKFavershamAndSittingbourne_Public => "Request Help from Age UK Faversham And Sittingbourne", RequestHelpFormVariant.AgeUKFavershamAndSittingbourne_RequestSubmitter => "Request Help from Age UK Faversham And Sittingbourne", RequestHelpFormVariant.AgeUKNorthWestKent_Public => "Request Help from Age UK North West Kent", RequestHelpFormVariant.AgeUKNorthWestKent_RequestSubmitter => "Request Help from Age UK North West Kent", RequestHelpFormVariant.Sandbox_RequestSubmitter => "SANDBOX request form", RequestHelpFormVariant.MeadowsCommunityHelpers_Public => "Request Help from the Meadows Community Helpers", RequestHelpFormVariant.MeadowsCommunityHelpers_RequestSubmitter => "Request Help from the Meadows Community Helpers", RequestHelpFormVariant.AgeConnectsCardiff_Public => "Request Help from Age Connects Cardiff and the Vale", RequestHelpFormVariant.AgeConnectsCardiff_RequestSubmitter => "Request Help from Age Connects Cardiff and the Vale", RequestHelpFormVariant.Soutwell_Public => "Request Help from Southwell Torpedos", _ => "What type of help are you looking for?" });
public async Task <ActionResult> Questions([FromBody] QuestionRequest request) { RequestHelpFormVariant requestHelpFormVariant = Enum.Parse <RequestHelpFormVariant>(request.FormVariant); RequestHelpFormStage requestHelpFormStage = Enum.Parse <RequestHelpFormStage>(request.FormStage); SupportActivities supportActivity = Enum.Parse <SupportActivities>(request.SupportActivity); QuestionsViewModel questionsViewModel = new QuestionsViewModel() { Questions = await _requestHelpBuilder.GetQuestionsForTask(requestHelpFormVariant, requestHelpFormStage, supportActivity, request.GroupId) }; questionsViewModel = questionsViewModel.GetQuestionsByLocation(request.Position); foreach (var question in questionsViewModel.Questions) { var matchedAnswer = request.Answers.Where(x => x.Id == question.ID && !string.IsNullOrEmpty(x.Answer)).FirstOrDefault(); if (matchedAnswer != null) { question.Model = matchedAnswer.Answer; } } return(PartialView("_Questions", questionsViewModel)); }
private async Task <QuestionsViewModel> UpdateQuestionsViewModel(QuestionsViewModel previousQuestionsViewModel, RequestHelpFormVariant requestHelpFormVariant, RequestHelpFormStage requestHelpFormStage, SupportActivities selectedSupportActivity, int groupId) { QuestionsViewModel updatedQuestionsViewModel = new QuestionsViewModel() { Questions = await _requestHelpBuilder.GetQuestionsForTask(requestHelpFormVariant, requestHelpFormStage, selectedSupportActivity, groupId) }; if (previousQuestionsViewModel != null) { foreach (RequestHelpQuestion question in updatedQuestionsViewModel.Questions) { var matchedQuestion = previousQuestionsViewModel.Questions.Where(pq => pq.ID == question.ID && !string.IsNullOrEmpty(pq.Model)).FirstOrDefault(); if (matchedQuestion != null) { question.Model = matchedQuestion.Model; } } } return(updatedQuestionsViewModel); }
private async Task <RequestHelpDetailStageViewModel> BindDetailStage(ModelBindingContext bindingContext, RequestHelpFormVariant requestHelpFormVariant, SupportActivities selectedSupportActivity, int groupId) { RequestHelpDetailStageViewModel model = JsonConvert.DeserializeObject <RequestHelpDetailStageViewModel>(bindingContext.ValueProvider.GetValue("DetailStep").FirstValue); var recpientnamePrefix = "currentStep.Recipient."; model.Recipient = new RecipientDetails { Firstname = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.Firstname)).FirstValue, Lastname = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.Lastname)).FirstValue, MobileNumber = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.MobileNumber)).FirstValue, AlternatePhoneNumber = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.AlternatePhoneNumber)).FirstValue, AddressLine1 = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.AddressLine1)).FirstValue, AddressLine2 = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.AddressLine2)).FirstValue, County = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.County)).FirstValue, Postcode = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.Postcode)).FirstValue, Email = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.Email)).FirstValue, Town = bindingContext.ValueProvider.GetValue(recpientnamePrefix + nameof(model.Recipient.Town)).FirstValue, }; var requestorPrefix = "currentStep.Requestor."; model.Requestor = new RequestorDetails { Firstname = bindingContext.ValueProvider.GetValue(requestorPrefix + nameof(model.Recipient.Firstname)).FirstValue, Lastname = bindingContext.ValueProvider.GetValue(requestorPrefix + nameof(model.Recipient.Lastname)).FirstValue, MobileNumber = bindingContext.ValueProvider.GetValue(requestorPrefix + nameof(model.Recipient.MobileNumber)).FirstValue, AlternatePhoneNumber = bindingContext.ValueProvider.GetValue(requestorPrefix + nameof(model.Recipient.AlternatePhoneNumber)).FirstValue, Postcode = bindingContext.ValueProvider.GetValue(requestorPrefix + nameof(model.Recipient.Postcode)).FirstValue, Email = bindingContext.ValueProvider.GetValue(requestorPrefix + nameof(model.Recipient.Email)).FirstValue, }; model.Organisation = bindingContext.ValueProvider.GetValue("currentStep.Organisation").FirstValue; model.Questions = new QuestionsViewModel() { Questions = await _requestHelpBuilder.GetQuestionsForTask(requestHelpFormVariant, RequestHelpFormStage.Detail, selectedSupportActivity, groupId) }; foreach (RequestHelpQuestion question in model.Questions.Questions) { question.Model = bindingContext.ValueProvider.GetValue($"currentStep.Questions.[{question.ID}].Model").FirstValue; } return(model); }
private async Task <RequestHelpRequestStageViewModel> BindRequestStage(ModelBindingContext bindingContext, RequestHelpFormVariant requestHelpFormVariant, int groupId) { RequestHelpRequestStageViewModel model = JsonConvert.DeserializeObject <RequestHelpRequestStageViewModel>(bindingContext.ValueProvider.GetValue("RequestStep").FirstValue); int selectedTaskId, selectedRequestorId, selectedTimeId = -1; int.TryParse(bindingContext.ValueProvider.GetValue("currentStep.SelectedTask.Id").FirstValue, out selectedTaskId); int.TryParse(bindingContext.ValueProvider.GetValue("currentStep.SelectedRequestor.Id").FirstValue, out selectedRequestorId); int.TryParse(bindingContext.ValueProvider.GetValue("currentStep.SelectedTimeFrame.Id").FirstValue, out selectedTimeId); model.Requestors.ForEach(x => x.IsSelected = false); var requestor = model.Requestors.Where(x => x.ID == selectedRequestorId).FirstOrDefault(); if (requestor != null) { requestor.IsSelected = true; } model.Tasks.ForEach(x => x.IsSelected = false); var task = model.Tasks.Where(x => (int)x.SupportActivity == selectedTaskId).FirstOrDefault(); if (task != null) { task.IsSelected = true; } model.Timeframes.ForEach(x => x.IsSelected = false); var time = model.Timeframes.Where(x => x.ID == selectedTimeId).FirstOrDefault(); if (time != null) { time.IsSelected = true; if (time.AllowCustom) { int selectedDays = -1; int.TryParse(bindingContext.ValueProvider.GetValue("currentStep.SelectedTimeFrame.CustomDays").FirstValue, out selectedDays); time.Days = selectedDays; } if (time.DueDateType.HasDate()) { DateTime.TryParseExact(bindingContext.ValueProvider.GetValue("currentStep.SelectedTimeFrame.Date").ToString(), DatePickerHelpers.DATE_PICKER_DATE_FORMAT, new CultureInfo("en-GB"), DateTimeStyles.None, out DateTime date); time.Date = date; if (time.DueDateType.HasStartTime()) { time.StartTime = ParseTime(time.Date, bindingContext.ValueProvider.GetValue("currentStep.SelectedTimeFrame.StartTime").ToString()); } if (time.DueDateType.HasEndTime()) { time.EndTime = ParseTime(time.Date, bindingContext.ValueProvider.GetValue("currentStep.SelectedTimeFrame.EndTime").ToString()); if (time.StartTime >= time.EndTime) { time.EndTime = time.EndTime.AddDays(1); } } } } model.Questions = new QuestionsViewModel() { Questions = await _requestHelpBuilder.GetQuestionsForTask(requestHelpFormVariant, RequestHelpFormStage.Request, task.SupportActivity, groupId) }; foreach (RequestHelpQuestion question in model.Questions.Questions) { question.Model = bindingContext.ValueProvider.GetValue($"currentStep.Questions.[{question.ID}].Model").FirstValue; } bool AgreeToPrivacyAndTerms = false; bool.TryParse(bindingContext.ValueProvider.GetValue("currentStep." + nameof(model.AgreeToPrivacyAndTerms)).FirstValue, out AgreeToPrivacyAndTerms); model.AgreeToPrivacyAndTerms = AgreeToPrivacyAndTerms; return(model); }
private static IEnumerable <SupportActivities> GetSupportActivitiesForRequestFormVariant(RequestHelpFormVariant form) { IEnumerable <SupportActivities> activites; IEnumerable <SupportActivities> genericSupportActivities = GetGenericSupportActivities(); switch (form) { case RequestHelpFormVariant.FtLOS: activites = new List <SupportActivities>() { SupportActivities.FaceMask }; break; case RequestHelpFormVariant.VitalsForVeterans: activites = new List <SupportActivities>(genericSupportActivities); ((List <SupportActivities>)activites).Add(SupportActivities.WellbeingPackage); ((List <SupportActivities>)activites).Add(SupportActivities.VolunteerSupport); break; case RequestHelpFormVariant.Ruddington: activites = new List <SupportActivities>(genericSupportActivities); ((List <SupportActivities>)activites).Remove(SupportActivities.HomeworkSupport); ((List <SupportActivities>)activites).Add(SupportActivities.VolunteerSupport); break; case RequestHelpFormVariant.AgeUKWirral: activites = new List <SupportActivities> { SupportActivities.Shopping, SupportActivities.CollectingPrescriptions, SupportActivities.Other, SupportActivities.Transport, SupportActivities.ColdWeatherArmy, SupportActivities.VolunteerSupport }; break; case RequestHelpFormVariant.AgeUKNottsBalderton: activites = new List <SupportActivities>() { SupportActivities.Shopping, SupportActivities.CollectingPrescriptions, SupportActivities.PhoneCalls_Friendly, SupportActivities.Other, SupportActivities.DogWalking }; break; case RequestHelpFormVariant.AgeUKSouthKentCoast_Public: activites = new List <SupportActivities>() { SupportActivities.Shopping, SupportActivities.CollectingPrescriptions, SupportActivities.PhoneCalls_Friendly, SupportActivities.MealtimeCompanion, SupportActivities.MealsToYourDoor, SupportActivities.Other }; break; case RequestHelpFormVariant.AgeUKSouthKentCoast_RequestSubmitter: activites = new List <SupportActivities>() { SupportActivities.Shopping, SupportActivities.CollectingPrescriptions, SupportActivities.PhoneCalls_Friendly, SupportActivities.MealtimeCompanion, SupportActivities.MealsToYourDoor, SupportActivities.VolunteerSupport, SupportActivities.Other }; break; case RequestHelpFormVariant.AgeUKFavershamAndSittingbourne_Public: activites = new List <SupportActivities>() { SupportActivities.PhoneCalls_Friendly, SupportActivities.MealtimeCompanion, SupportActivities.MealsToYourDoor, SupportActivities.Other }; break; case RequestHelpFormVariant.AgeUKFavershamAndSittingbourne_RequestSubmitter: activites = new List <SupportActivities>() { SupportActivities.PhoneCalls_Friendly, SupportActivities.MealtimeCompanion, SupportActivities.MealsToYourDoor, SupportActivities.VolunteerSupport, SupportActivities.Other }; break; case RequestHelpFormVariant.AgeUKNorthWestKent_Public: activites = new List <SupportActivities>() { SupportActivities.MealsToYourDoor, SupportActivities.CollectingPrescriptions, SupportActivities.PhoneCalls_Friendly, SupportActivities.Other }; break; case RequestHelpFormVariant.AgeUKNorthWestKent_RequestSubmitter: activites = new List <SupportActivities>() { SupportActivities.MealsToYourDoor, SupportActivities.CollectingPrescriptions, SupportActivities.PhoneCalls_Friendly, SupportActivities.VolunteerSupport, SupportActivities.Other }; break; case RequestHelpFormVariant.LincolnshireVolunteers: activites = new List <SupportActivities>() { SupportActivities.VaccineSupport, SupportActivities.VolunteerSupport, SupportActivities.EmergencySupport }; break; case RequestHelpFormVariant.Sandbox_RequestSubmitter: activites = new List <SupportActivities> { SupportActivities.Shopping, SupportActivities.CollectingPrescriptions, SupportActivities.Errands, SupportActivities.PhoneCalls_Friendly, SupportActivities.VolunteerSupport, SupportActivities.VaccineSupport, SupportActivities.Other, SupportActivities.EmergencySupport, }; break; case RequestHelpFormVariant.AgeConnectsCardiff_Public: activites = new List <SupportActivities> { SupportActivities.Shopping, SupportActivities.PhoneCalls_Friendly, SupportActivities.InPersonBefriending, SupportActivities.CollectingPrescriptions, SupportActivities.PracticalSupport, SupportActivities.Other }; break; case RequestHelpFormVariant.AgeConnectsCardiff_RequestSubmitter: activites = new List <SupportActivities> { SupportActivities.Shopping, SupportActivities.PhoneCalls_Friendly, SupportActivities.InPersonBefriending, SupportActivities.CollectingPrescriptions, SupportActivities.PracticalSupport, SupportActivities.VolunteerSupport, SupportActivities.Other }; break; case RequestHelpFormVariant.MeadowsCommunityHelpers_Public: activites = new List <SupportActivities> { SupportActivities.Shopping, SupportActivities.FaceMask, SupportActivities.CheckingIn, SupportActivities.CollectingPrescriptions, SupportActivities.Errands, SupportActivities.DigitalSupport, SupportActivities.PhoneCalls_Friendly, SupportActivities.BinDayAssistance, SupportActivities.Covid19Help, SupportActivities.Other }; break; case RequestHelpFormVariant.MeadowsCommunityHelpers_RequestSubmitter: activites = new List <SupportActivities> { SupportActivities.Shopping, SupportActivities.FaceMask, SupportActivities.CheckingIn, SupportActivities.CollectingPrescriptions, SupportActivities.Errands, SupportActivities.DigitalSupport, SupportActivities.PhoneCalls_Friendly, SupportActivities.BinDayAssistance, SupportActivities.Covid19Help, SupportActivities.VolunteerSupport, SupportActivities.Other }; break; case RequestHelpFormVariant.AgeUKNottsNorthMuskham: activites = new List <SupportActivities>() { SupportActivities.Shopping, SupportActivities.CollectingPrescriptions, SupportActivities.PhoneCalls_Friendly, SupportActivities.Errands, SupportActivities.DogWalking, SupportActivities.Other }; break; case RequestHelpFormVariant.Mansfield_CVS: activites = new List <SupportActivities>() { SupportActivities.VaccineSupport }; break; case RequestHelpFormVariant.Soutwell_Public: activites = new List <SupportActivities>() { SupportActivities.Shopping, SupportActivities.CollectingPrescriptions, SupportActivities.Other }; break; case RequestHelpFormVariant.Default: case RequestHelpFormVariant.FaceMasks: case RequestHelpFormVariant.DIY: activites = genericSupportActivities; break; case RequestHelpFormVariant.ApexBankStaff_RequestSubmitter: activites = new List <SupportActivities>() { SupportActivities.BankStaffVaccinator, SupportActivities.Other }; break; default: activites = new List <SupportActivities>(); break; } ; return(activites); }
public async Task <RequestHelpViewModel> GetSteps(RequestHelpJourney requestHelpJourney, int referringGroupID, string source) { RequestHelpFormVariant requestHelpFormVariant = requestHelpJourney.RequestHelpFormVariant; var model = new RequestHelpViewModel { ReferringGroupID = referringGroupID, Source = source, RequestHelpFormVariant = requestHelpFormVariant, CurrentStepIndex = 0, Steps = new List <IRequestHelpStageViewModel> { new RequestHelpRequestStageViewModel { PageHeading = GetHelpRequestPageTitle(requestHelpFormVariant), IntoText = GetHelpRequestPageIntroText(requestHelpFormVariant), Tasks = await GetRequestHelpTasks(requestHelpFormVariant), Requestors = new List <RequestorViewModel> { new RequestorViewModel { ID = 1, ColourCode = "orange", Title = "I am requesting help for myself", Text = "I'm the person in need of help", IconDark = "request-myself.svg", IconLight = "request-myself-white.svg", Type = RequestorType.Myself }, new RequestorViewModel { ID = 2, ColourCode = "dark-blue", Title = "On behalf of someone else", Text = "I'm looking for help for a relative, neighbour or friend", IconDark = "request-behalf.svg", IconLight = "request-behalf-white.svg", Type = RequestorType.OnBehalf }, new RequestorViewModel { ID = 3, ColourCode = "dark-blue", Title = "On behalf of an organisation", Text = "I'm looking for help for an organisation", IconDark = "request-organisation.svg", IconLight = "request-organisation-white.svg", Type = RequestorType.Organisation } }, Timeframes = new List <RequestHelpTimeViewModel> { new RequestHelpTimeViewModel { ID = 1, DueDateType = DueDateType.Before, TimeDescription = "Today", Days = 0 }, new RequestHelpTimeViewModel { ID = 2, DueDateType = DueDateType.Before, TimeDescription = "Within 24 Hours", Days = 1 }, new RequestHelpTimeViewModel { ID = 3, DueDateType = DueDateType.Before, TimeDescription = "Within a Week", Days = 7 }, new RequestHelpTimeViewModel { ID = 4, DueDateType = DueDateType.Before, TimeDescription = "When Convenient", Days = 30 }, new RequestHelpTimeViewModel { ID = 5, DueDateType = DueDateType.Before, TimeDescription = "Other", AllowCustom = true }, }, }, new RequestHelpDetailStageViewModel() { ShowRequestorFields = !requestHelpJourney.RequestorDefinedByGroup, FullRecipientAddressRequired = true, }, new RequestHelpReviewStageViewModel(), } }; if (requestHelpFormVariant == RequestHelpFormVariant.FtLOS) { ((RequestHelpRequestStageViewModel)model.Steps.First()).Timeframes.RemoveRange(0, 2); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeUKWirral || requestHelpFormVariant == RequestHelpFormVariant.VitalsForVeterans) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Requestors.RemoveAll(x => x.Type == RequestorType.Myself); requestStep.Timeframes.Insert(0, new RequestHelpTimeViewModel() { ID = 6, TimeDescription = "On a Specific Date", DueDateType = DueDateType.On }); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeUKSouthKentCoast_Public) { ((RequestHelpRequestStageViewModel)model.Steps.First()).Timeframes.RemoveRange(0, 2); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeUKSouthKentCoast_RequestSubmitter) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Timeframes.Insert(0, new RequestHelpTimeViewModel() { ID = 6, TimeDescription = "On a Specific Date", DueDateType = DueDateType.On }); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeUKFavershamAndSittingbourne_Public) { ((RequestHelpRequestStageViewModel)model.Steps.First()).Timeframes.RemoveRange(0, 2); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeUKFavershamAndSittingbourne_RequestSubmitter) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Timeframes.Insert(0, new RequestHelpTimeViewModel() { ID = 6, TimeDescription = "On a Specific Date", DueDateType = DueDateType.On }); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeUKNorthWestKent_Public) { ((RequestHelpRequestStageViewModel)model.Steps.First()).Timeframes.RemoveRange(0, 2); } if (requestHelpFormVariant == RequestHelpFormVariant.MeadowsCommunityHelpers_RequestSubmitter) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Requestors.RemoveAll(x => x.Type == RequestorType.Myself); } if (requestHelpFormVariant == RequestHelpFormVariant.MeadowsCommunityHelpers_Public) { ((RequestHelpRequestStageViewModel)model.Steps.First()).Timeframes.RemoveRange(0, 2); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeUKNorthWestKent_RequestSubmitter) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Timeframes.Insert(0, new RequestHelpTimeViewModel() { ID = 6, TimeDescription = "On a Specific Date", DueDateType = DueDateType.On }); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeConnectsCardiff_Public) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Timeframes.RemoveRange(0, 2); } if (requestHelpFormVariant == RequestHelpFormVariant.AgeConnectsCardiff_RequestSubmitter) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Requestors.RemoveAll(x => x.Type == RequestorType.Myself); requestStep.Timeframes.Insert(0, new RequestHelpTimeViewModel() { ID = 6, TimeDescription = "On a Specific Date", DueDateType = DueDateType.On }); } if (requestHelpFormVariant == RequestHelpFormVariant.LincolnshireVolunteers || requestHelpFormVariant == RequestHelpFormVariant.Mansfield_CVS || requestHelpFormVariant == RequestHelpFormVariant.ApexBankStaff_RequestSubmitter) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Requestors.RemoveAll(x => x.Type == RequestorType.Myself); requestStep.Requestors.RemoveAll(x => x.Type == RequestorType.OnBehalf); requestStep.Timeframes.Clear(); requestStep.Timeframes.Insert(0, new RequestHelpTimeViewModel() { ID = 7, TimeDescription = "On a Specific Date", DueDateType = DueDateType.SpecificStartAndEndTimes, IsSelected = true }); model.Steps.Remove(model.Steps.Where(x => x is RequestHelpDetailStageViewModel).First()); } if (requestHelpFormVariant == RequestHelpFormVariant.Sandbox_RequestSubmitter) { var requestStep = ((RequestHelpRequestStageViewModel)model.Steps.Where(x => x is RequestHelpRequestStageViewModel).First()); requestStep.Timeframes.Add(new RequestHelpTimeViewModel() { ID = 7, TimeDescription = "On a Specific Date", DueDateType = DueDateType.SpecificStartAndEndTimes }); } return(model); }