Exemplo n.º 1
0
 private void btnUredi_Click(object sender, EventArgs e)
 {
     if (dgvPacijenti.SelectedRows.Count > 0)
     {
         Klase.Pacijent    odabraniPacijent = dgvPacijenti.SelectedRows[0].DataBoundItem as Klase.Pacijent;
         FrmUrediPacijenta forma            = new FrmUrediPacijenta(odabraniPacijent);
         forma.ShowDialog();
         OsvjeziDataGridView();
     }
 }
Exemplo n.º 2
0
 private void btnObrisi_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvPacijenti.SelectedRows.Count > 0)
         {
             Klase.Pacijent pacijent = dgvPacijenti.SelectedRows[0].DataBoundItem as Klase.Pacijent;
             pacijent.ObrisiPacijenta();
             OsvjeziDataGridView();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (cbPacijenti.SelectedItem != null && cbVrstaPregleda.SelectedItem != null && txtOpis.Text != "")
                {
                    Klase.Pacijent      pacijent = cbPacijenti.SelectedItem as Klase.Pacijent;
                    Klase.VrstaPregleda vrsta    = cbVrstaPregleda.SelectedItem as Klase.VrstaPregleda;

                    string upit = "INSERT INTO pregled (doktor_id, pacijent_id, vrstapregleda, datumpregleda, opis) VALUES (" + Klase.Zaposlenik.PrijavljeniZaposlenik.Id + ", " + pacijent.Id + ", " + vrsta.Id + ", '" + dtpDatum.Value + "', '" + txtOpis.Text + "');";
                    Klase.Baza.Instanca.IzvrsiUpit(upit);
                    MessageBox.Show("Pregled uspješno rezerviran.", "Rezervirano", MessageBoxButtons.OK);
                    Close();
                }
                else
                {
                    MessageBox.Show("Niste unijeli sve podatke!", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Upozorenje", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 4
0
 public FrmUrediPacijenta(Klase.Pacijent proslijedeniPacijent)
 {
     InitializeComponent();
     pacijent = proslijedeniPacijent;
 }