Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (x == 0 || textBox2.Text == "" || textBox1.Text == "")
            {
                toolStripStatusLabel1.Text = "Unesite sve podatke!";
                return;
            }
            else
            {
                XmlSerializer xs = new XmlSerializer(typeof(List <Izuzetak>));

                using (Stream s = File.Open(FormaMain.fileName, FileMode.OpenOrCreate))
                    xs.Serialize(s, listaIzuzetaka.ToList <Izuzetak>());
                if (x == 1)//uprava ili osoblje
                {
                    FormaUprava formaupr = new FormaUprava();
                    formaupr.ShowDialog();
                }
                else if (x == 2) //doktor
                {
                    Doktor      d   = klinika17736.listaDoktora.FirstOrDefault(p => p.username == textBox1.Text);
                    FormaDoktor doc = new FormaDoktor(d);
                    doc.ShowDialog();
                }
                else if (x == 3)
                {
                    FormaOsoblje osob = new FormaOsoblje();
                    osob.ShowDialog();
                }
                else if (x == 4)
                {
                    Karton        p   = klinika17736.listaKartona.FirstOrDefault(k => k.username == textBox1.Text);
                    FormaPacijent pac = new FormaPacijent(p);
                    pac.ShowDialog();
                }
                textBox1.Text  = "";
                textBox2.Text  = "";
                comboBox1.Text = "";
                errorProvider1.Clear();
                errorProvider2.Clear();
                errorProvider3.Clear();
                toolStripStatusLabel1.Text = "";
            }
        }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (x == 0 || textBox2.Text == "" || textBox1.Text == "")
     {
         toolStripStatusLabel1.Text = "Unesite sve podatke!";
         return;
     }
     else
     {
         if (x == 1)//uprava ili osoblje
         {
             FormaUprava formaupr = new FormaUprava();
             formaupr.ShowDialog();
         }
         else if (x == 2) //doktor
         {
             Doktor      d   = klinika17736.listaDoktora.FirstOrDefault(p => p.username == textBox1.Text);
             FormaDoktor doc = new FormaDoktor(d);
             doc.ShowDialog();
         }
         else if (x == 3)
         {
             FormaOsoblje osob = new FormaOsoblje();
             osob.ShowDialog();
         }
         else if (x == 4)
         {
             Karton        p   = klinika17736.listaKartona.FirstOrDefault(k => k.username == textBox1.Text);
             FormaPacijent pac = new FormaPacijent(p);
             pac.ShowDialog();
         }
         textBox1.Text  = "";
         textBox2.Text  = "";
         comboBox1.Text = "";
         errorProvider1.Clear();
         errorProvider2.Clear();
         errorProvider3.Clear();
         toolStripStatusLabel1.Text = "";
     }
 }