コード例 #1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)//giriş
 {
     try
     {
         baglanti.con.Open();
         SqlCommand    cmd    = new SqlCommand("Select * from Hemsire where hemsire_TC='" + txtTC.Text + "' and hemsire_Sifre='" + txtSifre.Password + "'", baglanti.con);
         SqlDataReader reader = cmd.ExecuteReader();
         if (reader.Read())
         {
             hg = new HastaKabul();
             hg.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);
        }