예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Hasta hastamiz = new Hasta();

            hastamiz.TCKimlikNo = textBox1.Text;
            hastamiz.Adi        = textBox2.Text;
            hastamiz.Soyadi     = textBox3.Text;
            Randevu r = new Randevu();

            r.Kisi  = hastamiz;
            r.bolum = comboBox1.SelectedItem.ToString();
            r.tarih = dateTimePicker1.Value.ToShortDateString();
            r.saat  = comboBox2.SelectedItem.ToString();

            RandevuSistemi rs    = new RandevuSistemi();
            bool           varMi = rs.BTSArama(r);

            if (varMi == true)
            {
                MessageBox.Show("Secilen Bolume, secilen tarih ve saatte randevu var");
            }
            else
            {
                rs.RandevuEkle(r);
                MessageBox.Show("Randevu alınmıştır");
            }
        }
        private void Form2_Load(object sender, EventArgs e)
        {
            RandevuSistemi rs     = new RandevuSistemi();
            string         icerik = rs.Listele();

            textBox1.Text = icerik;
        }