Esempio n. 1
0
        private void btn_salvar_Click(object sender, EventArgs e)
        {
            bool resultado = ValidadoresTarefa.ValidadorNovaTarefa(txt_nome.Text, _id, txt_descricao.Text, date_data.Value);

            if (resultado)
            {
                MessageBox.Show("Nova tarefa cadastrada");
                this.Visible = false;
                new Usuario(_id).ShowDialog();
            }
            else
            {
                MessageBox.Show("Parece que tem algo faltando por ai");
            }
        }
Esempio n. 2
0
        private void btn_atualizar_Click(object sender, EventArgs e)
        {
            var dialog = MessageBox.Show("Deseja atualizar?", "Atualizar", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (dialog == DialogResult.Yes)
            {
                bool result = ValidadoresTarefa.ValidadorAtualizar(txt_nome.Text, txtbox_grande.Text, date_data.Value, _tarefa.IdPessoa, _tarefa.Id, cb_situacao.Text);
                if (result)
                {
                    this.Visible = false;
                    new Usuario(Convert.ToInt32(_tarefa.IdPessoa)).ShowDialog();
                }
                else
                {
                    MessageBox.Show("Errar é humano, mas olha...\n\nNão consigo atualizar assim não, sinto muito");
                }
            }
        }
Esempio n. 3
0
        private void btn_excluir_Click(object sender, EventArgs e)
        {
            var dialog = MessageBox.Show("Deseja excluir?", "Excluir", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (dialog == DialogResult.Yes)
            {
                bool result = ValidadoresTarefa.ExcluirTarefa(idselecao);

                if (result)
                {
                    this.Visible = false;
                    new Usuario(Convert.ToInt32(_tarefa.IdPessoa)).ShowDialog();
                }

                else
                {
                    MessageBox.Show("Hmmm, aparentemente o valor da tarefa é nulo");
                }
            }
        }