Beispiel #1
0
        private void btSalvar_Click(object sender, EventArgs e)
        {
            try
            {
                btSalvar.Hide();
                btCancelar.Hide();
                btDeletar.Hide();
                GroupBoxdadosDaConsulta.Hide();

                viewAgendamentos.Enabled = false;
                viewAgendamentos.DefaultCellStyle.BackColor = Color.LightGray;

                btEditar.Show();
                btNovo.Show();

                Validate();

                tabagendamentoBindingSource.EndEdit();
                tableAdapterManager.UpdateAll(bDMARCAFACILDataSet);
                bDMARCAFACILDataSet.tab_agendamento.AcceptChanges();
                bDMARCAFACILDataSet.tab_colaboradores.AcceptChanges();
                bDMARCAFACILDataSet.tab_paciente.AcceptChanges();
                tab_agendamentoTableAdapter.Fill(bDMARCAFACILDataSet.tab_agendamento);

                MessageBox.Show("Dados de agendamento salvos com sucesso!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
        private void btNovo_Click(object sender, EventArgs e)
        {
            viewAgendamentos.Enabled = true;
            viewAgendamentos.DefaultCellStyle.BackColor = Color.White;

            btEditar.Hide();
            btNovo.Hide();
            btDeletar.Show();
            btSalvar.Show();
            btCancelar.Show();
            GroupBoxdadosDaConsulta.Show();
        }
Beispiel #3
0
        public Agendamentos()
        {
            InitializeComponent();

            viewAgendamentos.Enabled = false;
            viewAgendamentos.DefaultCellStyle.BackColor = Color.LightGray;

            btSalvar.Hide();
            btCancelar.Hide();
            btDeletar.Hide();
            GroupBoxdadosDaConsulta.Hide();
        }
Beispiel #4
0
        private void btCancelar_Click(object sender, EventArgs e)
        {
            try
            {
                GroupBoxdadosDaConsulta.Hide();
                btDeletar.Hide();
                btSalvar.Hide();
                btCancelar.Hide();
                btNovo.Show();
                btEditar.Show();

                tabagendamentoBindingSource.EndEdit();
                tab_agendamentoTableAdapter.Fill(bDMARCAFACILDataSet.tab_agendamento);

                viewAgendamentos.Enabled = false;
                viewAgendamentos.DefaultCellStyle.BackColor = Color.LightGray;

                viewAgendamentos.Focus();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }