Esempio n. 1
0
        private void BtnCriar_Click(object sender, EventArgs e)
        {
            var id_obra = Convert.ToInt32(cbObras.SelectedValue);

            if (!validarCampos(id_obra, txtCitacao.Text))
            {
                return;
            }

            if (Citacao.criarCitacao(id_obra, txtCitacao.Text))
            {
                Close();
                MessageBox.Show("A citação foi criada com sucesso.");
            }
            else
            {
                MessageBox.Show("Não foi possível criar a citação. Por favor, tente novamente !");
            }
        }
Esempio n. 2
0
        private void btnCitacaoDel_Click(object sender, EventArgs e)
        {
            if (this.citacao_selecionada == null)
            {
                lbCitacaoSelecionado.Text = "Por favor, selecione uma citação para a remoção.";
                return;
            }

            if (Citacao.excluirCitacao(this.citacao_selecionada.id))
            {
                MessageBox.Show("Citação excluída com sucesso.");
                LoadControl();
            }
            else
            {
                MessageBox.Show("Não foi possível exclui a citação. Por favor, tente novamente.");
            }


            ClearCitacao();
        }
Esempio n. 3
0
        private void LoadControl()
        {
            List <citacao> citacoes = Citacao.listarCitacao();

            lvCitacao.Items.Clear();

            if (citacoes == null)
            {
                return;
            }

            foreach (var citacao in citacoes)
            {
                var linha_citacao = new string[] { citacao.conteudo };
                var lvItem        = new ListViewItem(linha_citacao);

                lvItem.Tag = citacao;

                lvCitacao.Items.Add(lvItem);
            }
        }
Esempio n. 4
0
        private void BtnEditar_Click(object sender, EventArgs e)
        {
            if (this.id_citacao == 0)
            {
                return;
            }

            if (!validarCampos(txtCitacao.Text))
            {
                return;
            }

            if (Citacao.editarCitacao(this.id_citacao, txtCitacao.Text))
            {
                Close();
                MessageBox.Show("Citação modificar com sucesso.");
            }
            else
            {
                MessageBox.Show("Não foi possível editar a citação. Por favor, tente novamente.");
            }
        }
 public void Update(Citacao obj)
 {
     throw new NotImplementedException();
 }
 public Citacao Insert(Citacao obj)
 {
     throw new NotImplementedException();
 }