private void Button_Click(object sender, RoutedEventArgs e)//giriş
        {
            try
            {
                baglanti.con.Open();
                SqlCommand    cmd    = new SqlCommand("Select * from Doktor where doktor_TC='" + txtTC.Text + "' and doktor_Sifre='" + txtSifre.Password + "'", baglanti.con);
                SqlDataReader reader = cmd.ExecuteReader();
                if (reader.Read())
                {
                    doctor      = reader["doktor_Ad"].ToString() + " " + reader["doktor_Soyad"].ToString();
                    DoktorTcTut = txtTC.Text;
                    dGiris      = new Poliklinik();
                    dGiris.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("TC No veya şifreyi yanlış girdiniz!");
                }
            }

            catch (Exception)
            {
                throw;
            }

            finally
            {
                if (baglanti.con != null)
                {
                    baglanti.con.Close();
                }
            }
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            doktorGiris   = new DoktorGiris(); doktorKayit = new DoktorKayit(); hastaDuzenle = new HastaDuzenle();
            onayEkrani    = new OnayEkrani(); hastaKabul = new HastaKabul(); hastaKayit = new HastaKayit();
            hemsireGiris  = new HemsireGiris(); hemsireKayit = new HemsireKayit();
            monitörEkrani = new MonitorEkrani(); poliklinik = new Poliklinik(); yeniSifre = new YeniSifre();

            doktorGiris.mainWindow  = this; doktorKayit.mainWindow = this; hastaDuzenle.mainWindow = this;
            onayEkrani.mainWindow   = this; hastaKabul.mainWindow = this; hastaKayit.mainWindow = this;
            hemsireGiris.mainWindow = this; hemsireKayit.mainWindow = this; monitörEkrani.mainWindow = this;
            poliklinik.mainWindow   = this; yeniSifre.mainWindow = this;
            this.PreviewKeyDown    += new KeyEventHandler(HandleEsc1);
        }