public async Task <WorkingDayStatDto> Stat(int id)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(id, -1);
            pathParams.Add <string>("stat", -1);

            var settings = new HttpSettings($"{this.Url}", null, pathParams);

            return(await this.Http.Get <WorkingDayStatDto>(settings));
        }
示例#2
0
        public async Task <bool> AddMovieToMyMovies(int id)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(id, -1);
            var settings = new HttpSettings($"{this.Url}/map", null, pathParams, "Adding movie to My Movies");

            var body = new HttpBody <object>(null);

            return(await this.Http.Create <object>(settings, body));
        }
示例#3
0
        public Task <CsomorRole> GetRole(int id)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add(id, -1);
            pathParams.Add("role", -1);

            var settings = new HttpSettings($"{this._url}", null, pathParams);

            return(this._http.Get <CsomorRole>(settings));
        }
示例#4
0
        public async Task <WorkingMonthStatDto> GetMonthStat(int year, int month)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(year, -1);
            pathParams.Add <int>(month, -1);

            var settings = new HttpSettings($"{this.Url}/month-stat", null, pathParams);

            return(await this.Http.Get <WorkingMonthStatDto>(settings));
        }
示例#5
0
        public Task <bool> ExportXls(int id, ExportSettingsModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add(id, -1);
            pathParams.Add("export", -1);
            pathParams.Add("xls", -1);

            var settings = new HttpSettings($"{this._url}", null, pathParams, "Exporting to XLS");

            return(this._http.Download(settings, model));
        }
示例#6
0
        public Task <bool> Update(int id, GeneratorSettingsModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add(id, -1);

            var settings = new HttpSettings($"{this._url}", null, pathParams, "Generator setting updating");

            var body = new HttpBody <GeneratorSettingsModel>(model);

            return(this._http.Update <GeneratorSettingsModel>(settings, body));
        }
        /// <inheritdoc />
        public async Task <bool> Registration(RegistrationModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add("registration", -1);

            var settings = new HttpSettings(Url, null, pathParams, "Registration");

            var body = new HttpBody <RegistrationModel>(model);

            return(await _httpService.Create(settings, body));
        }
示例#8
0
        public async Task <bool> UpdateCategories(int id, SeriesCategoryUpdateModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(id, -1);

            var settings = new HttpSettings($"{this.Url}/categories", null, pathParams, "Series category updating");

            var body = new HttpBody <SeriesCategoryUpdateModel>(model);

            return(await this.Http.Update <SeriesCategoryUpdateModel>(settings, body));
        }
示例#9
0
        public async Task <bool> AddIncremented(int seasonId)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(seasonId, -1);

            var settings = new HttpSettings($"{this.Url}", null, pathParams, "Episode adding");

            var body = new HttpBody <object>(null);

            return(await this.Http.Create <object>(settings, body));
        }
示例#10
0
        public async Task <bool> UpdateImage(int id, EpisodeImageModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(id, -1);

            var settings = new HttpSettings($"{this.Url}/image", null, pathParams, "Episode image updating");

            var body = new HttpBody <EpisodeImageModel>(model);

            return(await this.Http.Update <EpisodeImageModel>(settings, body));
        }
示例#11
0
        public async Task <bool> RemoveFriend(string friendId)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <string>(friendId, -1);

            var toaster = new ToasterSettings("Friend removing");

            var settings = new HttpSettings($"{this._url}", null, pathParams, toaster);

            return(await this._httpService.Delete(settings));
        }
示例#12
0
        public async Task <bool> UpdateRate(int id, MovieRateModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add <int>(id, -1);

            var settings = new HttpSettings($"{this.Url}/rate", null, pathParams, "Movie rating");

            var body = new HttpBody <MovieRateModel>(model);

            return(await this.Http.Update <MovieRateModel>(settings, body));
        }
示例#13
0
        /// <summary>
        /// Set current Period
        /// </summary>
        /// <param name="id">New Period</param>
        /// <returns>Async result</returns>
        public async Task <bool> SetCurrent(int id)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add("current", -1);

            var settings = new HttpSettings(Url + "/" + this.Entity, null, pathParams, "Set current period");

            var body = new HttpBody <int>(id);

            return(await HttpService.Update(settings, body));
        }
示例#14
0
        public Task <bool> Share(int id, List <CsomorAccessModel> models)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add(id, -1);
            pathParams.Add("share", -1);

            var settings = new HttpSettings($"{this._url}", null, pathParams, "Csomor sharing");

            var body = new HttpBody <List <CsomorAccessModel> >(models);

            return(this._http.Update <List <CsomorAccessModel> >(settings, body));
        }
示例#15
0
        public Task <bool> ChangePublicStatus(int id, GeneratorPublishModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add(id, -1);
            pathParams.Add("publish", -1);

            var settings = new HttpSettings($"{this._url}", null, pathParams, "Public status changing");

            var body = new HttpBody <GeneratorPublishModel>(model);

            return(this._http.Update <GeneratorPublishModel>(settings, body));
        }
示例#16
0
        /// <summary>
        /// Get Hour interval by endpoints
        /// </summary>
        /// <param name="from">From number</param>
        /// <param name="to">To number</param>
        /// <returns>Create Hour interval</returns>
        public Task <LessonHourIntervalDto> GetHourInterval(int from, int to)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add("interval", -1);

            var queryParams = new HttpQueryParameters();

            queryParams.Add("from", from);
            queryParams.Add("to", to);

            var settings = new HttpSettings(Url + "/" + this.Entity, queryParams, pathParams);

            return(HttpService.Get <LessonHourIntervalDto>(settings));
        }
        /// <inheritdoc />
        public async Task <bool> Login(LoginModel model)
        {
            var pathParams = new HttpPathParameters();

            pathParams.Add("login", -1);

            var settings = new HttpSettings(Url, null, pathParams, "Login");

            var body = new HttpBody <LoginModel>(model);

            var user = await _httpService.CreateWithResult <StorageUser, LoginModel>(settings, body);

            if (user == null)
            {
                return(false);
            }

            await _localStorageService.SetItemAsync("user", user);

            await _localStorageService.SetItemAsync("token", user.Token);

            _storeService.Add("user", user);
            return(true);
        }