示例#1
0
        private async void Excluir()
        {
            if (Aluno != null && Aluno.Id > 0)
            {
                var alunoExistente = alunoService.ObterPorId(Aluno.Id);
                if (alunoExistente.Validar)
                {
                    Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Excluindo dados do aluno. Aguarde...");

                    Progresso.SetIndeterminate();
                    var   t = Task.Factory.StartNew(() => { alunoService.Excluir(alunoExistente.Id); });
                    await t;
                    await Progresso?.CloseAsync();

                    await this.dialog.ShowMessageAsync(this, "Atenção", "Aluno excluído com sucesso !!!");

                    Limpar();
                    BuscarAlunos();
                }
                else
                {
                    await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", alunoExistente.Notifications.Select(s => s.Mensagem)));

                    alunoService.ClearNotifications();
                }
            }
        }
        private async void Inativar()
        {
            if (View != null && View.Id > 0)
            {
                var caixinhaDada = caixinhaService.ObterPorId(View.Id);
                if (caixinhaDada != null)
                {
                    var inativarCaixinha = await MessageBoxQuestion("Atenção!", "Deseja mesmo inativar esta caixinha para este(a) dealer <S/N>?");

                    if (inativarCaixinha)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Inativando registro de caixinha para dealer. Aguarde...");

                        Progresso.SetIndeterminate();
                        var   t = Task.Factory.StartNew(() => { caixinhaService.Inativar(View.Id, "Carlosg"); });
                        await t;
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Registro de caixinha para dealer inativado com sucesso !!!");

                        Limpar();
                    }
                }
                else
                {
                    await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", caixinhaDada.Notificacoes.Select(s => s.Mensagem)));

                    caixinhaService.LimparNotificacoes();
                }
            }
        }
示例#3
0
        private async void Alterar()
        {
            if (View != null && View.Id > 0)
            {
                var retiradaEfetuada = rakeService.ObterPorId(View.Id);
                if (retiradaEfetuada != null)
                {
                    Request.Id       = View.Id;
                    Request.Valor    = View.Valor;
                    retiradaEfetuada = rakeService.Alterar(Request, "Carlosg");
                    if (rakeService.Validar)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Alterando dados da retirada de rake. Aguarde...");

                        Progresso.SetIndeterminate();
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Retirada de rake alterada com sucesso !!!");

                        Limpar();
                    }
                    else
                    {
                        await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", rakeService.Notificacoes.Select(s => s.Mensagem)));

                        rakeService.LimparNotificacoes();
                        BuscarRakes();
                    }
                }
            }
        }
        private async void Incluir()
        {
            Request.Id       = View.Id;
            Request.IdDealer = DealerView.Id;
            Request.Data     = View.Data;
            Request.Valor    = View.Valor;
            var caixinhaDada = caixinhaService.Incluir(Request, "Carlosg");

            if (!caixinhaService.Validar)
            {
                var linq = caixinhaService.Notificacoes.Select(msg => msg.Mensagem);
                await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", linq));

                caixinhaService.LimparNotificacoes();
            }
            if (caixinhaDada != null)
            {
                Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Registrando caixinha para dealer. Aguarde...");

                Progresso.SetIndeterminate();
                var   t = Task.Factory.StartNew(() => { Limpar(); });
                await t;
                await Progresso?.CloseAsync();

                await this.dialog.ShowMessageAsync(this, "Atenção", "Caixinha para dealer registrada com sucesso !!!");

                //Limpar();
            }
        }
        private async void Alterar()
        {
            if (View != null && View.Id > 0)
            {
                var caixinhaDada = caixinhaService.ObterPorId(View.Id);
                if (caixinhaDada != null)
                {
                    Request.Id    = View.Id;
                    Request.Valor = View.Valor;
                    caixinhaDada  = caixinhaService.Alterar(Request, "Carlosg");
                    if (caixinhaService.Validar)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Alterando registro de caixinha para dealer. Aguarde...");

                        Progresso.SetIndeterminate();
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Registro de caixinha para dealer alterado com sucesso !!!");

                        Limpar();
                    }
                    else
                    {
                        await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", caixinhaService.Notificacoes.Select(s => s.Mensagem)));

                        caixinhaService.LimparNotificacoes();
                        BuscarCaixinhas();
                    }
                }
            }
        }
        private async void Inativar()
        {
            if (View != null && View.Id > 0)
            {
                var clienteExistente = clienteService.ObterPorId(View.Id);
                if (clienteExistente != null)
                {
                    var inativarCliente = await MessageBoxQuestion("Atenção!", "Deseja mesmo inativar este cliente <S/N>?");

                    if (inativarCliente)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Inativando cliente. Aguarde...");

                        Progresso.SetIndeterminate();
                        var   t = Task.Factory.StartNew(() => { clienteService.Inativar(View.Id, "Carlosg"); });
                        await t;
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Cliente inativado com sucesso !!!");

                        Limpar();
                        //BuscarClientes();
                    }
                }
                else
                {
                    await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", clienteExistente.Notificacoes.Select(s => s.Mensagem)));

                    clienteService.LimparNotificacoes();
                }
            }
        }
        private async void Incluir()
        {
            Request.Id        = View.Id;
            Request.IdCliente = ClienteView.Id;
            Request.Data      = View.Data;
            Request.Valor     = View.Valor;
            var compraEfetuada = comprarFichaService.Incluir(Request, "Carlosg");

            if (!comprarFichaService.Validar)
            {
                var linq = comprarFichaService.Notificacoes.Select(msg => msg.Mensagem);
                await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", linq));

                comprarFichaService.LimparNotificacoes();
            }
            if (compraEfetuada != null)
            {
                Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Efetuando compra de fichas. Aguarde...");

                Progresso.SetIndeterminate();
                var   t = Task.Factory.StartNew(() => { Limpar(); });
                await t;
                await Progresso?.CloseAsync();

                await this.dialog.ShowMessageAsync(this, "Atenção", "Compra efetuada com sucesso !!!");

                //Limpar();
            }
        }
        private async void Incluir()
        {
            Request.Id       = View.Id;
            Request.Nome     = View.Nome;
            Request.Telefone = View.Telefone;
            var clienteCriado = clienteService.Incluir(Request, "Carlosg");

            if (!clienteService.Validar)
            {
                var linq = clienteService.Notificacoes.Select(msg => msg.Mensagem);
                await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", linq));

                clienteService.LimparNotificacoes();
            }
            if (clienteCriado != null)
            {
                Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Incluindo dados do cliente. Aguarde...");

                Progresso.SetIndeterminate();
                var   t = Task.Factory.StartNew(() => { Limpar(); });
                await t;
                await Progresso?.CloseAsync();

                await this.dialog.ShowMessageAsync(this, "Atenção", "Cliente cadastrado com sucesso !!!");

                //Limpar();
            }
        }
        private async void Alterar()
        {
            if (View != null && View.Id > 0)
            {
                var clienteExistente = clienteService.ObterPorId(View.Id);
                if (clienteExistente != null)
                {
                    Request.Id       = View.Id;
                    Request.Telefone = View.Telefone;
                    clienteExistente = clienteService.Alterar(Request, "Carlosg");
                    if (clienteService.Validar)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Alterando dados do cliente. Aguarde...");

                        Progresso.SetIndeterminate();
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Cliente alterado com sucesso !!!");

                        Limpar();
                    }
                    else
                    {
                        await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", clienteService.Notificacoes.Select(s => s.Mensagem)));

                        clienteService.LimparNotificacoes();
                        BuscarClientes();
                    }
                }
            }
        }
示例#10
0
        private async void Inativar()
        {
            if (View != null && View.Id > 0)
            {
                var retiradaEfetuada = rakeService.ObterPorId(View.Id);
                if (retiradaEfetuada != null)
                {
                    var inativarRake = await MessageBoxQuestion("Atenção!", "Deseja mesmo inativar esta retirada de rake <S/N>?");

                    if (inativarRake)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Inativando a retirada de rake. Aguarde...");

                        Progresso.SetIndeterminate();
                        var   t = Task.Factory.StartNew(() => { rakeService.Inativar(View.Id, "Carlosg"); });
                        await t;
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Retirada de rake inativado com sucesso !!!");

                        Limpar();
                    }
                }
                else
                {
                    await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", retiradaEfetuada.Notificacoes.Select(s => s.Mensagem)));

                    rakeService.LimparNotificacoes();
                }
            }
        }
示例#11
0
        private async void Incluir()
        {
            var novoAluno   = new Aluno(Aluno.Nome, Aluno.Endereco, Aluno.Bairro, Aluno.Cidade);
            var alunoCriado = alunoService.Incluir(novoAluno);

            if (!alunoService.Validar)
            {
                var linq = alunoService.Notifications.Select(msg => msg.Mensagem);
                await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", linq));

                alunoService.ClearNotifications();
            }
            if (alunoCriado != null)
            {
                Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Incluindo dados do aluno. Aguarde...");

                Progresso.SetIndeterminate();
                var   t = Task.Factory.StartNew(() => { BuscarAlunos(); });
                await t;
                await Progresso?.CloseAsync();

                await this.dialog.ShowMessageAsync(this, "Atenção", "Aluno cadastrado com sucesso !!!");

                Limpar();
            }
        }
示例#12
0
        private async void Inativar()
        {
            if (View != null && View.Id > 0)
            {
                var cursoExistente = cursoService.ObterPorId(View.Id);
                if (cursoExistente != null)
                {
                    Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Inativando curso. Aguarde...");

                    Progresso.SetIndeterminate();
                    var   t = Task.Factory.StartNew(() => { cursoService.Inativar(View.Id, "Carlosg"); });
                    await t;
                    await Progresso?.CloseAsync();

                    await this.dialog.ShowMessageAsync(this, "Atenção", "Curso inativado com sucesso !!!");

                    Limpar();
                    BuscarCursos();
                }
                else
                {
                    await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", cursoExistente.Notificacoes.Select(s => s.Mensagem)));

                    cursoService.LimparNotificacoes();
                }
            }
        }
示例#13
0
        private async void Incluir()
        {
            Request.Descricao    = View.Descricao;
            Request.CargaHoraria = View.CargaHoraria;
            Request.Valor        = View.Valor;
            var cursoCriado = cursoService.Incluir(Request, "Carlosg");

            if (!cursoService.Validar)
            {
                var linq = cursoService.Notificacoes.Select(msg => msg.Mensagem);
                await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", linq));

                cursoService.LimparNotificacoes();
            }
            if (cursoCriado != null)
            {
                Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Incluindo dados do curso. Aguarde...");

                Progresso.SetIndeterminate();
                var   t = Task.Factory.StartNew(() => { BuscarCursos(); });
                await t;
                await Progresso?.CloseAsync();

                await this.dialog.ShowMessageAsync(this, "Atenção", "Curso cadastrado com sucesso !!!");

                Limpar();
            }
        }
        private async void Inativar()
        {
            if (View != null && View.Id > 0)
            {
                var pagtoEfetuado = pagtoJogadorService.ObterPorId(View.Id);
                if (pagtoEfetuado != null)
                {
                    var inativarPagto = await MessageBoxQuestion("Atenção!", "Deseja mesmo inativar este pagamento ao jogador <S/N>?");

                    if (inativarPagto)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Inativando o pagamento ao jogador. Aguarde...");

                        Progresso.SetIndeterminate();
                        var   t = Task.Factory.StartNew(() => { pagtoJogadorService.Inativar(View.Id, "Carlosg"); });
                        await t;
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Pagamento ao jogador inativado com sucesso !!!");

                        Limpar();
                    }
                }
                else
                {
                    await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", pagtoEfetuado.Notificacoes.Select(s => s.Mensagem)));

                    pagtoJogadorService.LimparNotificacoes();
                }
            }
        }
        private async void Alterar()
        {
            if (View != null && View.Id > 0)
            {
                var pagtoEfetuado = pagtoJogadorService.ObterPorId(View.Id);
                if (pagtoEfetuado != null)
                {
                    Request.Id    = View.Id;
                    Request.Valor = View.Valor;
                    pagtoEfetuado = pagtoJogadorService.Alterar(Request, "Carlosg");
                    if (pagtoJogadorService.Validar)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Alterando dados do pagamento ao jogador. Aguarde...");

                        Progresso.SetIndeterminate();
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Pagamento ao jogador alterado com sucesso !!!");

                        Limpar();
                    }
                    else
                    {
                        await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", pagtoJogadorService.Notificacoes.Select(s => s.Mensagem)));

                        pagtoJogadorService.LimparNotificacoes();
                        BuscarPagamentos();
                    }
                }
            }
        }
示例#16
0
        private async void Incluir()
        {
            Request.Alimento    = View.Alimento;
            Request.Peso        = View.Peso;
            Request.Proteina    = View.Proteina;
            Request.Carboidrato = View.Carboidrato;
            Request.Gordura     = View.Gordura;
            Request.Caloria     = View.Caloria;
            var alimentoCriado = alimentoService.Incluir(Request, "Carlosg");

            if (!alimentoService.Validar)
            {
                var linq = alimentoService.Notificacoes.Select(msg => msg.Mensagem);
                await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", linq));

                alimentoService.LimparNotificacoes();
            }
            if (alimentoCriado != null)
            {
                Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Incluindo dados do alimento. Aguarde...");

                Progresso.SetIndeterminate();
                var   t = Task.Factory.StartNew(() => { BuscarAlimentos(); });
                await t;
                await Progresso?.CloseAsync();

                await this.dialog.ShowMessageAsync(this, "Atenção", "Alimento cadastrado com sucesso !!!");

                Limpar();
            }
        }
示例#17
0
        private async void Alterar()
        {
            if (View != null && View.Id > 0)
            {
                var alimentoExistente = alimentoService.ObterPorId(View.Id);
                if (alimentoExistente != null)
                {
                    Request.Id          = View.Id;
                    Request.Peso        = View.Peso;
                    Request.Proteina    = View.Proteina;
                    Request.Carboidrato = View.Carboidrato;
                    Request.Gordura     = View.Gordura;
                    Request.Caloria     = View.Caloria;
                    alimentoExistente   = alimentoService.Alterar(Request, "Carlosg");
                    if (alimentoService.Validar)
                    {
                        Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Alterando dados do alimento. Aguarde...");

                        Progresso.SetIndeterminate();
                        await Progresso?.CloseAsync();

                        await this.dialog.ShowMessageAsync(this, "Atenção", "Alimento alterado com sucesso !!!");

                        Limpar();
                    }
                    else
                    {
                        await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", alimentoService.Notificacoes.Select(s => s.Mensagem)));

                        alimentoService.LimparNotificacoes();
                    }
                    BuscarAlimentos();
                }
            }
        }
示例#18
0
        private async void Executar()
        {
            fechamentoService.Fechamento(DataInicial, DataFinal);
            if (!fechamentoService.Validar)
            {
                var linq = fechamentoService.Notificacoes.Select(msg => msg.Mensagem);
                await this.dialog.ShowMessageAsync(this, "Atenção", string.Join("\r\n", linq));

                fechamentoService.LimparNotificacoes();
            }
            else
            {
                Progresso = await dialog.ShowProgressAsync(this, "Progresso", "Gerando relatório de fechamento. Aguarde...");

                Progresso.SetIndeterminate();
                await Progresso?.CloseAsync();

                await this.dialog.ShowMessageAsync(this, "Atenção", "Fechamento executado com sucesso !!!");

                Limpar();
            }
        }