Example #1
0
        private void btnGravar_Click(object sender, EventArgs e)
        {
            if (validaDados())
            {
                int id = Convert.ToInt32(txtId.Text);

                nome = tratarStr(txtNome.Text);
                cpf  = tratarStr(txtCpf.Text);
                rg   = tratarStr(txtRg.Text);
                dt   = dtNasc.Text;
                fone = tratarStr(txtFone.Text);
                sexo = (rdbMasc.Checked ? "M" : "F");
                nac  = tratarStr(txtNac.Text);
                end  = tratarStr(txtEnd.Text);
                num  = tratarStr(txtNum.Text);
                cep  = tratarStr(txtCep.Text);
                uf   = tratarStr(cbxUf.Text);

                daoPaciente dp = new daoPaciente();
                if (dp.editPac(id, nome, cpf, rg, dt, fone, sexo, nac, end, num, cep, uf))
                {
                    frmPaciente fr = new frmPaciente();
                    fr.atualizaGrid();
                    this.Close();
                }
            }
        }