Ejemplo n.º 1
0
        public async Task <bool> UpdatePerson(Group group, Person person)
        {
            try
            {
                var request = await HttpService.PatchAsync($"persongroups/{group.PersonGroupId}/persons/{person.PersonId}", person);

                if (!request.IsSuccessStatusCode)
                {
                    await HttpService.ShowError(request);

                    return(false);
                }

                ToastService.Show("Pessoa atualizado com sucesso!", person.Name);
                return(true);
            }
            catch (Exception exception)
            {
                await new MessageDialog($"Error Message: {exception.Message}").ShowAsync();
                return(false);
            }
        }
Ejemplo n.º 2
0
        public async Task <bool> DeletePersonFace(Group group, Person person, Face face)
        {
            try
            {
                var request = await HttpService.DeleteAsync($"persongroups/{group.PersonGroupId}/persons/{person.PersonId}/persistedfaces/{face.PersistedFaceId}");

                if (!request.IsSuccessStatusCode)
                {
                    await HttpService.ShowError(request);

                    return(false);
                }

                ToastService.Show("Face excluída com sucesso!", person.Name);
                return(true);
            }
            catch (Exception exception)
            {
                await new MessageDialog($"Error Message: {exception.Message}").ShowAsync();
                return(false);
            }
        }
Ejemplo n.º 3
0
        public async Task TrainPersonGroup(Group group)
        {
            try
            {
                var request = await HttpService.PostAsync($"persongroups/{group.PersonGroupId}/train", null);

                if (!request.IsSuccessStatusCode)
                {
                    await HttpService.ShowError(request);
                }
                else
                {
                    if (request.StatusCode == HttpStatusCode.Accepted)
                    {
                        ToastService.Show("Grupo treinado com sucesso!", group.Name);
                    }
                }
            }
            catch (Exception exception)
            {
                await new MessageDialog($"Error Message: {exception.Message}").ShowAsync();
            }
        }