Beispiel #1
0
        //editar o serviço na tela

        private void btnEditar_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ServicoController servicoController = new ServicoController();
                Servico           servico           = new Servico();
                servico.ServicoID   = Convert.ToInt32(txtId.Text);
                servico.NomeServico = txtServico.Text;
                servico.Valor       = Convert.ToInt32(txtValor.Text);
                servico.Categoria   = txtCategoria.Text;
                servicoController.Editar(servico);
                MessageBox.Show("Editado com sucesso");
                btnGravar.Visibility = Visibility.Visible;
                listServico.Items.Refresh();
                txtId.Text        = "";
                txtServico.Text   = "";
                txtValor.Text     = "";
                txtCategoria.Text = "";
                ListaServicos(servicoController);
            }
            catch
            {
                MessageBox.Show("Não foi possivel editar");
            }
        }
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Beispiel #3
0
        private void btnGravar_Click(object sender, RoutedEventArgs e)
        {
            ServicoController servicoController = new ServicoController();
            Servico           servico           = new Servico();
            Aluno             aluno             = new Aluno();

            servico = (Servico)listaServicoAluno.SelectedItem;
            var ser = servico.ServicoID;

            aluno.IDServico = ser;


            this.Close();
        }
Beispiel #4
0
        //seleciona o item na lista
        private void listServico_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ServicoController servicoController = new ServicoController();

            try
            {
                Servico servico = (Servico)listServico.SelectedItem;
                Preencher(servico);
            }
            catch
            {
                MessageBox.Show("Nenhum item selecionado");
            }
        }
Beispiel #5
0
        private void cadastroVendas_Load(object sender, EventArgs e)
        {
            ClienteController clienteController = new ClienteController();

            cbCliente.Items.AddRange(clienteController.ListarClientes().ToArray());

            ProdutoController produtoController = new ProdutoController();

            cbProduto.Items.AddRange(produtoController.ListarProdutosDisponiveis().ToArray());

            ServicoController servicoController = new ServicoController();

            cbServico.Items.AddRange(servicoController.ListarServicos().ToArray());

            dtpDataVenda.Value = DateTime.Now;
        }
Beispiel #6
0
 private void btnExcluir_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ServicoController servicoController = new ServicoController();
         var idExclusão = Convert.ToInt32(txtId.Text);
         servicoController.Excluir(idExclusão);
         MessageBox.Show("Excluido com sucesso");
         servicoController.ListarTodos();
         //listServico.ItemsSource = servicoController.ListarTodos();
     }
     catch
     {
         MessageBox.Show("Não é possivel efetuar a exclusão");
     }
 }
Beispiel #7
0
        private void btnGravar_Click(object sender, RoutedEventArgs e)
        {
            ServicoController servicoController = new ServicoController();
            Servico           servico           = new Servico();



            try
            {
                servico.NomeServico = txtServico.Text;
                servico.Valor       = Convert.ToInt32(txtValor.Text);
                servico.Categoria   = txtCategoria.Text;
                servicoController.Adicionar(servico);
                MessageBox.Show("Cadastrado com sucesso");
                ListaServicos(servicoController);
            }
            catch
            {
                MessageBox.Show("Não foi possivel cadastrar");
            }
        }
Beispiel #8
0
 private void listaServicoAluno_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ServicoController servicoController = new ServicoController();
     Servico           servico           = new Servico();
     //var recebeu = servico.ServicoID;
 }
Beispiel #9
0
        private void listaServicoAluno_Initialized(object sender, EventArgs e)
        {
            ServicoController servicoController = new ServicoController();

            listaServicoAluno.ItemsSource = servicoController.ListarTodos();
        }
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            ServicoController servicoController = new ServicoController();

            servicoController.CadastrarServico(txbNome, txtDesc, txbPreco, currentUser);
        }
Beispiel #11
0
        private void cbServico_Loaded(object sender, RoutedEventArgs e)
        {
            ServicoController servicoController = new ServicoController();

            cbServico.ItemsSource = servicoController.ListarTodos();
        }
Beispiel #12
0
 //preneche a lista depois de clicar em gravar
 public void  ListaServicos(ServicoController servicoController)
 {
     listServico.ItemsSource = servicoController.ListarTodos();
 }