Exemplo n.º 1
0
        public void GetSaveData()
        {
            // data from the state of the map (satellite / plan)
            var result = false;

            if (_saveDataService.Contains(App.MapChange))
            {
                bool.TryParse(_saveDataService.GetData(App.MapChange), out result);
                App.Locator.BaseMap.IsInNormalMode = result;
            }
            // data from the state of traking when seekios is out of zone
            if (_saveDataService.Contains(App.TrackingSetting))
            {
                App.Locator.ModeSelection.LsTrackingSetting = JsonConvert.DeserializeObject <List <TrackingSetting> >(_saveDataService.GetData(App.TrackingSetting));
            }
        }
Exemplo n.º 2
0
        public async void PopupRelaodCreditMonthly()
        {
            RelaodCreditMonthly hasBeenRead = null;

            if (!_saveDataService.Contains(App.NeedToDisplayReloadCreditMonthly))
            {
                hasBeenRead = new RelaodCreditMonthly()
                {
                    HasBeenRead = true, DateHasBeenReand = DateTime.Now
                };
                _saveDataService.SaveData(App.NeedToDisplayReloadCreditMonthly, JsonConvert.SerializeObject(hasBeenRead, new JsonSerializerSettings()
                {
                    DateFormatHandling   = DateFormatHandling.MicrosoftDateFormat,
                    DateParseHandling    = DateParseHandling.DateTime,
                    DateTimeZoneHandling = DateTimeZoneHandling.Local
                }));
            }
            else
            {
                var json = _saveDataService.GetData(App.NeedToDisplayReloadCreditMonthly);
                hasBeenRead = JsonConvert.DeserializeObject <RelaodCreditMonthly>(json, new JsonSerializerSettings()
                {
                    DateFormatHandling   = DateFormatHandling.MicrosoftDateFormat,
                    DateParseHandling    = DateParseHandling.DateTime,
                    DateTimeZoneHandling = DateTimeZoneHandling.Local
                });
            }

            int currentMonth = (DateTime.Now.Month == 1 && hasBeenRead.DateHasBeenReand.Month == 12 ? 13 : DateTime.Now.Month);

            if (DateTime.Now.Day >= 16 && DateTime.Now.Hour > 6 && currentMonth > hasBeenRead.DateHasBeenReand.Month)
            {
                if (App.CurrentUserEnvironment.LsSeekios?.Count > 0)
                {
                    await _dialogService.ShowPopupCredit(Resources.RelaodCreditMonthlyTitle
                                                         , Resources.RelaodCreditMonthlyContent);
                }
                hasBeenRead.DateHasBeenReand = DateTime.Now;
                _saveDataService.SaveData(App.NeedToDisplayReloadCreditMonthly, JsonConvert.SerializeObject(hasBeenRead, new JsonSerializerSettings()
                {
                    DateFormatHandling   = DateFormatHandling.MicrosoftDateFormat,
                    DateParseHandling    = DateParseHandling.DateTime,
                    DateTimeZoneHandling = DateTimeZoneHandling.Local
                }));
            }
        }