Пример #1
0
        public void Navigate()
        {
            if (SelectedFeature != null)
            {
                switch (SelectedFeature.TypeId)
                {
                case APLPX.Client.Entity.ModuleFeatureType.Null:
                    break;

                case APLPX.Client.Entity.ModuleFeatureType.StartupLogin:
                    break;

                case APLPX.Client.Entity.ModuleFeatureType.PlanningHome:
                    break;

                case APLPX.Client.Entity.ModuleFeatureType.TrackingHome:
                    break;

                case APLPX.Client.Entity.ModuleFeatureType.ReportingHome:
                    break;

                case APLPX.Client.Entity.ModuleFeatureType.AdministrationHome:
                    break;

                case APLPX.Client.Entity.ModuleFeatureType.PlanningAnalytics:

                    if (!_featureCache.ContainsKey(SelectedFeature.TypeId))
                    {
                        var analyticDtos     = _analyticService.LoadList(new DTO.Session <DTO.NullT>()).Data;
                        var displayAnalytics = analyticDtos.ToDisplayEntities();
                        var iSearchables     = displayAnalytics.Cast <ISearchableEntity>().ToList();
                        SelectedFeature.SearchableEntities = iSearchables;
                        _featureCache.Add(SelectedFeature.TypeId, SelectedFeature);
                    }
                    else
                    {
                        SelectedFeatureViewModel.SelectedFeature = _featureCache[SelectedFeature.TypeId];
                    }
                    SelectedFeature.SelectedStep = SelectedFeature.DefaultLandingStep;

                    break;

                case APLPX.Client.Entity.ModuleFeatureType.PlanningPromotionPricing:
                case APLPX.Client.Entity.ModuleFeatureType.PlanningEverydayPricing:
                case APLPX.Client.Entity.ModuleFeatureType.PlanningKitPricing:
                    SelectedFeatureViewModel = new SearchViewModel(SelectedFeature);
                    break;

                default:
                    SelectedFeatureViewModel = null;
                    break;
                }
            }
            else
            {
                SelectedFeatureViewModel = null;
            }
        }
        public Session <List <Analytic> > LoadAnalyticList()
        {
            var response = _analyticService.LoadList(new DTO.Session <DTO.NullT> {
                SqlKey = _session.SqlKey
            });
            List <DTO.Analytic> analyticDtos = response.Data;
            var displayAnalytics             = analyticDtos != null?analyticDtos.ToDisplayEntities() : null;


            var s = new Session <List <Analytic> >
            {
                Authenticated    = response.Authenticated,
                SqlAuthorization = response.SqlAuthorization,
                ClientMessage    = response.ClientMessage ?? null,
                Data             = displayAnalytics,
                ServerMessage    = response.ServerMessage ?? null,
                SessionOk        = response.SessionOk,
                User             = response.User != null?response.User.ToDisplayEntity() : null,
            };

            return(s);
        }