예제 #1
0
        public static async Task <LoginResponse> Login(string loginArgs)
        {
            if (!ConnectedToInternet())
            {
                return(new LoginResponse {
                    status = SERVICE_RESPONSE.NO_CONNECTION
                });
            }
            var loginResponse = await ServiceAccessor.MakeApiCallPost(ServiceAccessor.URL_SERVICE_LOGIN, loginArgs, false);

            if (!string.IsNullOrEmpty(loginResponse))
            {
                var obj = JsonConvert.DeserializeObject <LoginResponseDTO>(loginResponse);
                AppDataAccessor.SetAuthToken(obj.Token);
                return(new LoginResponse {
                    status = SERVICE_RESPONSE.SUCCESS
                });
            }
            else
            {
                return(new LoginResponse {
                    status = SERVICE_RESPONSE.CREDENTIALS
                });
            }
        }
예제 #2
0
        public async void LogFilterApplied(List <String> filters)
        {
            LogEntry entry = new LogEntry();

            entry.Function   = Function.View.ToString();
            entry.Operation  = Operation.ClipDataColumn.ToString();
            entry.Error      = null;
            entry.Method     = "Filter";
            entry.ErrorLevel = ErrorLevel.Info.ToString();

            entry.AttributesDictionary = new Dictionary <string, object>();
            entry.AttributesDictionary.Add("Method", "Filter");
            entry.AttributesDictionary.Add("Filters", filters);

            entry.Attributes           = JsonConvert.SerializeObject(entry.AttributesDictionary);
            entry.AttributesDictionary = null;

            ServiceAccessor.MakeApiCallLog(ServiceAccessor.URL_SERVICE_LOG, JsonConvert.SerializeObject(entry));
        }
예제 #3
0
        public async void LogSortApplied(FilterViewModel filterVM)
        {
            LogEntry entry = new LogEntry();

            entry.Function   = Function.View.ToString();
            entry.Operation  = Operation.ClipDataColumn.ToString();
            entry.Error      = null;
            entry.Method     = "Sort";
            entry.ErrorLevel = ErrorLevel.Info.ToString();

            entry.AttributesDictionary = new Dictionary <string, object>();
            entry.AttributesDictionary.Add("Method", "Sort");
            entry.AttributesDictionary.Add("Sort", filterVM.sortType.ToString());
            entry.AttributesDictionary.Add("Column", filterVM.ColumnHeaderName);

            entry.Attributes           = JsonConvert.SerializeObject(entry.AttributesDictionary);
            entry.AttributesDictionary = null;

            ServiceAccessor.MakeApiCallLog(ServiceAccessor.URL_SERVICE_LOG, JsonConvert.SerializeObject(entry));
        }
예제 #4
0
        public async void LogPlaylistDownloadRemoved(Playlist playlist)
        {
            LogEntry entry = new LogEntry();

            entry.Function   = Function.Download.ToString();
            entry.Operation  = Operation.Cutup.ToString();
            entry.Error      = null;
            entry.Method     = "PlaylistDownloadRemoved";
            entry.ErrorLevel = ErrorLevel.Info.ToString();

            entry.AttributesDictionary = new Dictionary <string, object>();
            entry.AttributesDictionary.Add("Method", "PlaylistDownloadRemoved");
            entry.AttributesDictionary.Add("Playlist", playlist.playlistId);
            entry.AttributesDictionary.Add("RemovedOn", DateTime.Now);

            entry.Attributes           = JsonConvert.SerializeObject(entry.AttributesDictionary);
            entry.AttributesDictionary = null;

            ServiceAccessor.MakeApiCallLog(ServiceAccessor.URL_SERVICE_LOG, JsonConvert.SerializeObject(entry));
        }
예제 #5
0
        public async void LogGameSelected(Game game, string description = "GameSelected")
        {
            LogEntry entry = new LogEntry();

            entry.Function   = Function.Click.ToString();
            entry.Operation  = Operation.Game.ToString();
            entry.Error      = null;
            entry.Method     = description;
            entry.ErrorLevel = ErrorLevel.Info.ToString();

            entry.AttributesDictionary = new Dictionary <string, object>();
            entry.AttributesDictionary.Add("Method", description);
            entry.AttributesDictionary.Add("Game", game.gameId);
            entry.AttributesDictionary.Add("ClickedOn", DateTime.Now);

            entry.Attributes           = JsonConvert.SerializeObject(entry.AttributesDictionary);
            entry.AttributesDictionary = null;

            ServiceAccessor.MakeApiCallLog(ServiceAccessor.URL_SERVICE_LOG, JsonConvert.SerializeObject(entry));
        }
예제 #6
0
        public async void LogSeasonChanged(Season season)
        {
            LogEntry entry = new LogEntry();

            entry.Function   = Function.Click.ToString();
            entry.Operation  = Operation.Season.ToString();
            entry.Error      = null;
            entry.Method     = "SeasonChanged";
            entry.ErrorLevel = ErrorLevel.Info.ToString();

            entry.AttributesDictionary = new Dictionary <string, object>();
            entry.AttributesDictionary.Add("Method", "SeasonChanged");
            entry.AttributesDictionary.Add("Season", season.seasonId);
            entry.AttributesDictionary.Add("Year", season.year);
            entry.AttributesDictionary.Add("ClickedOn", DateTime.Now);

            entry.Attributes           = JsonConvert.SerializeObject(entry.AttributesDictionary);
            entry.AttributesDictionary = null;

            ServiceAccessor.MakeApiCallLog(ServiceAccessor.URL_SERVICE_LOG, JsonConvert.SerializeObject(entry));
        }