Exemplo n.º 1
0
        private void btIncuir_Click(object sender, EventArgs e)
        {
            Servico servico = new Servico();

            servico.DescricaoSERVICO = txtNomeFuncionario.Text;
            servico.PrecoSERVICO     = Convert.ToDecimal(txtNomeFuncionario.Text);

            ServicoBLL bll      = new ServicoBLL();
            string     mensagem = bll.CadastrarServico(servico);

            MessageBox.Show(mensagem, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            DesabiltarBotoes();

            CarregarServico(bll.ListaServico());
        }
Exemplo n.º 2
0
        private void btIncuir_Click(object sender, EventArgs e)
        {
            Servico servico = new Servico();

            if (txtDescricao.Text == "")
            {
                MessageBox.Show("Por favor escreva o nome do serviço !!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtDescricao.BackColor = Color.Yellow;
                txtDescricao.Focus();
                return;
            }
            else
            {
                servico.DescricaoSERVICO  = txtDescricao.Text;
                txtPrecoServico.BackColor = Color.White;
            }

            if (txtPrecoServico.Text == string.Empty || txtPrecoServico.Text == "0" || txtPrecoServico.Text == "")
            {
                MessageBox.Show("Campo preço do serviço esta vázio!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtPrecoServico.BackColor = Color.Yellow;
                txtPrecoServico.Focus();
                return;
            }
            else
            {
                txtPrecoServico.BackColor = Color.White;
                servico.PrecoSERVICO      = Convert.ToDecimal(txtPrecoServico.Text);
            }

            ServicoBLL bll      = new ServicoBLL();
            string     mensagem = bll.CadastrarServico(servico);

            MessageBox.Show(mensagem, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            DesabiltarBotoes();

            CarregarServico(bll.ListaServico());
            LimpaCampos();
        }