public static void AdicionarExameParaDataBase(DataStore datahelper, DadosExame exames)
        {
            DataRow datarow = datahelper.TableExames.NewRow();

            datarow[DataStore.EXAME_DATE]        = exames.date;
            datarow[DataStore.EXAME_CLIENT_ID]   = exames.ClienteId;
            datarow[DataStore.EXAME_ANNOTATIONS] = exames.annotations;
            datarow[DataStore.EXAM_ID]           = exames.id;
            datarow[DataStore.EXAM_DADOS]        = exames.leitura;
            datahelper.TableExames.Rows.Add(datarow);
            datahelper.Guardar();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Tem a certeza que pretende guardar um novo Exame?", "Alerta:", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                DadosExame exameParaAdicionar = new DadosExame(DateTime.Now, ClienteParaEditar.Id, textBox1.Text, string.Join(",", valoresExame));
                DadosExame.AdicionarExameParaDataBase(datahelper, exameParaAdicionar);

                this.Hide();
                Form4 q = new Form4(clienteParaEditar);
                q.ShowDialog();
                this.Close();
            }
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            int indexToRemove = dataGridView1.CurrentCell.RowIndex;

            if (indexToRemove > -1)
            {
                DialogResult result = MessageBox.Show("Tem a certeza que quer Remover o Exame selecionado?", "Atencao", MessageBoxButtons.OKCancel);
                if (result == DialogResult.OK)
                {
                    DadosExame.removerDaBaseDados(datahelper, indexToRemove, clienteParaEditar.Id);
                }
            }
            else
            {
                MessageBox.Show("Por favor selecione um paciente!");
            }
        }