public PacientForm() { InitializeComponent(); if (action == 1) { btn_del.Enabled = false; } else if (action == 2) { btn_del.Enabled = true; PacientObj p = PacientObj.getById(id); if (p.id > 0) { name.Text = p.name; lastname.Text = p.lastname; address.Text = p.address; email.Text = p.email; phone.Text = p.phone; } else { MessageBox.Show("No se encontro el paciente."); } } }
void fill(List <ReservationObj> res) { dataGridView1.Rows.Clear(); foreach (ReservationObj r in res) { MedicObj m = MedicObj.getById(r.medic_id); PacientObj p = PacientObj.getById(r.pacient_id); dataGridView1.Rows.Add(r.id, r.title, p.name + " " + p.lastname, m.name + " " + m.name, r.date_at + "/" + r.time_at); } }