private void OnSelectedStepChanged(ModuleFeatureStep step) { this.RaisePropertyChanged("IsStepSelectorAvailable"); if (step != null) { SelectedFeatureViewModel = GetViewModel(step); } }
/// <summary> /// Gets the view model corresponding to a <see cref="ModuleFeatureStep"/>. /// </summary> /// <param name="step"></param> /// <returns>The view model, as a <see cref="ViewModelBase"/> object.</returns> private ViewModelBase GetViewModel(ModuleFeatureStep step) { ViewModelBase result = null; switch (step.TypeId) { case DTO.ModuleFeatureStepType.StartupLoginInitialization: break; case DTO.ModuleFeatureStepType.StartupLoginAuthentication: break; case DTO.ModuleFeatureStepType.StartupLoginChangepassword: break; case DTO.ModuleFeatureStepType.PlanningHomeDashboard: result = new HomeViewModel(); break; //Search case DTO.ModuleFeatureStepType.PlanningAnalyticsSearchAnalytics: case DTO.ModuleFeatureStepType.PlanningEverydayPricingSearchEveryday: case DTO.ModuleFeatureStepType.PlanningPromotionPricingSearchPromotions: case DTO.ModuleFeatureStepType.PlanningKitPricingSearchKits: result = new SearchViewModel(SelectedFeature); break; //Identity case DTO.ModuleFeatureStepType.PlanningAnalyticsIdentity: result = new AnalyticIdentityViewModel(SelectedAnalytic); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingIdentity: case DTO.ModuleFeatureStepType.PlanningPromotionPricingIdentity: case DTO.ModuleFeatureStepType.PlanningKitPricingIdentity: result = new PricingIdentityViewModel(SelectedPriceRoutine); break; //Filters case DTO.ModuleFeatureStepType.PlanningAnalyticsFilters: result = new FilterViewModel(SelectedAnalytic); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingFilters: case DTO.ModuleFeatureStepType.PlanningPromotionPricingFilters: case DTO.ModuleFeatureStepType.PlanningKitPricingFilters: result = new FilterViewModel(SelectedPriceRoutine); break; //Price Lists case DTO.ModuleFeatureStepType.PlanningAnalyticsPriceLists: result = new PriceListViewModel(SelectedEntity, SelectedAnalytic.PriceListGroups); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingPriceLists: case DTO.ModuleFeatureStepType.PlanningPromotionPricingPriceLists: case DTO.ModuleFeatureStepType.PlanningKitPricingPriceLists: result = new PriceListViewModel(SelectedEntity, SelectedPriceRoutine.PriceListGroups); break; //Value Drivers case DTO.ModuleFeatureStepType.PlanningAnalyticsValueDrivers: result = new AnalyticDriverViewModel(SelectedAnalytic.Drivers); break; //Results case DTO.ModuleFeatureStepType.PlanningAnalyticsResults: result = new AnalyticResultsViewModel(SelectedAnalytic); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingResults: case DTO.ModuleFeatureStepType.PlanningPromotionPricingResults: case DTO.ModuleFeatureStepType.PlanningKitPricingResults: break; //Rounding case DTO.ModuleFeatureStepType.PlanningEverydayPricingRounding: case DTO.ModuleFeatureStepType.PlanningPromotionPricingRounding: case DTO.ModuleFeatureStepType.PlanningKitPricingRounding: break; //Stragegy case DTO.ModuleFeatureStepType.PlanningEverydayPricingStrategy: case DTO.ModuleFeatureStepType.PlanningPromotionPricingStrategy: case DTO.ModuleFeatureStepType.PlanningKitPricingStrategy: break; //Forecast case DTO.ModuleFeatureStepType.PlanningEverydayPricingForecast: case DTO.ModuleFeatureStepType.PlanningPromotionPricingForecast: case DTO.ModuleFeatureStepType.PlanningKitPricingForecast: break; //Approval case DTO.ModuleFeatureStepType.PlanningEverydayPricingApproval: case DTO.ModuleFeatureStepType.PlanningPromotionPricingApproval: case DTO.ModuleFeatureStepType.PlanningKitPricingApproval: break; case DTO.ModuleFeatureStepType.TrackingHomeDashboard: break; case DTO.ModuleFeatureStepType.ReportingHomeDashboard: break; case DTO.ModuleFeatureStepType.AdministrationHomeDashboard: break; case DTO.ModuleFeatureStepType.AdministrationUserMaintenanceSearchUsers: break; case DTO.ModuleFeatureStepType.AdministrationUserMaintenanceUserLogin: break; case DTO.ModuleFeatureStepType.AdministrationUserMaintenanceUserIdentity: break; case DTO.ModuleFeatureStepType.AdministrationUserMaintenanceUserRole: break; case DTO.ModuleFeatureStepType.Null: default: break; } return(result); }
private static List <DisplayEntities.Action> GetSampleActions(ModuleFeatureStep step) { var result = new List <DisplayEntities.Action>(); switch (step.TypeId) { case DTO.ModuleFeatureStepType.Null: break; case DTO.ModuleFeatureStepType.PlanningAnalyticsSearchAnalytics: result.Add(new DisplayEntities.Action { Name = "Copy", ParentName = "Copy", Title = "Workflow View Step Action, Copy Analytics", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsSearchAnalyticsCopy, Sort = 3, }); result.Add(new DisplayEntities.Action { Name = "Edit", ParentName = "Edit", Title = "Workflow View Step Action, Edit Analytics", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsSearchAnalyticsEdit, Sort = 2, }); result.Add(new DisplayEntities.Action { Name = "New", ParentName = "New", Title = "Workflow View Step Action, New Analytics", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsSearchAnalyticsNew, Sort = 1, }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingSearchEveryday: result.Add(new DisplayEntities.Action { Name = "Copy", ParentName = "Copy", Title = "Workflow View Step Action, Copy Everyday", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingSearchEverydayCopy, Sort = 3, }); result.Add(new DisplayEntities.Action { Name = "Edit", ParentName = "Edit", Title = "Workflow View Step Action, Edit Everyday", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingSearchEverydayEdit, Sort = 2, }); result.Add(new DisplayEntities.Action { Name = "New", ParentName = "New", Title = "Workflow View Step Action, New Everyday", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingSearchEverydayNew, Sort = 1, }); break; case DTO.ModuleFeatureStepType.PlanningPromotionPricingSearchPromotions: result.Add(new DisplayEntities.Action { Name = "Copy", ParentName = "Copy", Title = "Workflow View Step Action, Copy Promotions", TypeId = DTO.ModuleFeatureStepActionType.PlanningPromotionPricingSearchPromotionsCopy, Sort = 3, }); result.Add(new DisplayEntities.Action { Name = "Edit", ParentName = "Edit", Title = "Workflow View Step Action, Edit Promotions", TypeId = DTO.ModuleFeatureStepActionType.PlanningPromotionPricingSearchPromotionsEdit, Sort = 2, }); result.Add(new DisplayEntities.Action { Name = "New", ParentName = "New", Title = "Workflow View Step Action, New Promotions", TypeId = DTO.ModuleFeatureStepActionType.PlanningPromotionPricingSearchPromotionsNew, Sort = 1, }); break; case DTO.ModuleFeatureStepType.PlanningAnalyticsIdentity: result.Add(new DisplayEntities.Action { Name = "Cancel", Title = "Discard all changes since the last save.", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsIdentityCancel, Sort = 2 }); result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save this item", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsIdentitySave, Sort = 4 }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingIdentity: result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save this item", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingIdentitySave, Sort = 4 }); break; case DTO.ModuleFeatureStepType.PlanningAnalyticsFilters: result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save this item", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsFiltersSave, Sort = 1 }); result.Add(new DisplayEntities.Action { Name = "Run", Title = "Run calculations", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsFiltersRun, Sort = 2 }); result.Add(new DisplayEntities.Action { Name = "Cancel", Title = "Discard unsaved changes.", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsFiltersCancel, Sort = 3 }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingFilters: result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save this item", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingFiltersSave, Sort = 4 }); break; case DTO.ModuleFeatureStepType.PlanningAnalyticsPriceLists: result.Add(new DisplayEntities.Action { Name = "Run", Title = "Run calculations", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsPriceListsRun, Sort = 3 }); result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save this item", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsPriceListsSave, Sort = 4 }); break; case DTO.ModuleFeatureStepType.PlanningAnalyticsValueDrivers: result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save this item", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsValueDriversSave, Sort = 1 }); result.Add(new DisplayEntities.Action { Name = "Cancel", Title = "Discard all changes since the last save.", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsValueDriversCancel, Sort = 2 }); result.Add(new DisplayEntities.Action { Name = "Run", Title = "Calculate results.", TypeId = DTO.ModuleFeatureStepActionType.PlanningAnalyticsResultsRun, Sort = 3 }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingPriceLists: break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingRounding: result.Add(new DisplayEntities.Action { Name = "Run", Title = "Run calculations", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingRoundingSave, Sort = 1 }); break; case DTO.ModuleFeatureStepType.PlanningAnalyticsResults: result.Add(new DisplayEntities.Action { Name = "Run", Title = "Workflow View Step Action, Run Analytics Results.", Sort = 1 }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingResults: result.Add(new DisplayEntities.Action { Name = "Show", ParentName = "Warnings", Title = "Show Warnings.", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingResultsWarningsShow, Sort = 1 }); result.Add(new DisplayEntities.Action { Name = "Hide", ParentName = "Warnings", Title = "Hide Warnings.", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingResultsWarningsHide, Sort = 2 }); result.Add(new DisplayEntities.Action { Name = "Apply", ParentName = "Rounding", Title = "Apply Rounding.", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingResultsRoundingApply, Sort = 3 }); result.Add(new DisplayEntities.Action { Name = "Remove", ParentName = "Rounding", Title = "Remove Rounding.", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingResultsRoundingRemove, Sort = 4 }); result.Add(new DisplayEntities.Action { Name = "Options", ParentName = "Options", Title = "Options", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingResultsOptions, Sort = 5 }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingStrategy: result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save this item", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingStrategySave, Sort = 1 }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingForecast: result.Add(new DisplayEntities.Action { Name = "Add Forecast", Title = "Add forecast", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingForecastNew, Sort = 1 }); result.Add(new DisplayEntities.Action { Name = "Save", Title = "Save forecast", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingForecastSave, Sort = 2 }); result.Add(new DisplayEntities.Action { Name = "Delete", Title = "Delete forecast", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingForecastDelete, Sort = 3 }); break; case DTO.ModuleFeatureStepType.PlanningEverydayPricingApproval: result.Add(new DisplayEntities.Action { Name = "Submit", Title = "Submit", TypeId = DTO.ModuleFeatureStepActionType.PlanningEverydayPricingApprovalSubmit, Sort = 1 }); break; default: result.Add(new DisplayEntities.Action { Name = "Step 1", Title = "Step 1 (title goes here)", Sort = 1 }); result.Add(new DisplayEntities.Action { Name = "Step 2", Title = "Step 2 (title goes here)", Sort = 2 }); result.Add(new DisplayEntities.Action { Name = "Step 3", Title = "Step 3 (title goes here)", Sort = 3 }); break; } foreach (DisplayEntities.Action action in result) { if (String.IsNullOrWhiteSpace(action.ParentName)) { action.ParentName = action.Name; } } return(result); }