Exemplo n.º 1
0
        public JsonResult GetJsonPost()
        {
            informationContentProvider = new InformationContentProvider();
            tokenProvider = new TokenProvider();
            string token = string.Empty;
            InfrastructureModel <InformationContentSingleDataModel> infrastructureModel = new InfrastructureModel <InformationContentSingleDataModel>();

            if (SessionExtension.GetSessionUser(HttpContext.Session) == null)
            {
                token = tokenProvider.GetAnonimToken();
                SessionExtension.Set(HttpContext.Session, "FreeToken", token);
                infrastructureModel = informationContentProvider.GetInformationContentSingleData(new InformationContentPostModel()
                {
                    TokenKey = token
                });
            }
            else
            {
                AppUserModel appUserModel = SessionExtension.GetSessionUser(HttpContext.Session);
                if (appUserModel != null)
                {
                    token = appUserModel.TokenKey;

                    infrastructureModel = informationContentProvider.GetInformationContentSingleData(new InformationContentPostModel()
                    {
                        AppUserId = appUserModel.AppUser.AppUserId, TokenKey = token
                    });
                }
            }
            return(Json(infrastructureModel));
        }
        public SplashScreen()
        {
            InitializeComponent();

            tokenProvider = new TokenProvider();
            string token = tokenProvider.GetAnonimToken();

            Application.Current.Properties["token"] = token;
            Application.Current.SavePropertiesAsync();

            if (Application.Current.Properties.ContainsKey("appUserId"))
            {
                imgLogo.Opacity = 0;
                imgLogo.FadeTo(1, 2000);
                Navigation.PushModalAsync(new LeftMenu());
            }
            else
            {
                LogoAnimation();
            }
        }