コード例 #1
0
        private void Btn_kirala_Click(object sender, EventArgs e)
        {
            AracKiralama ak = new AracKiralama();

            ak.Show();
            this.Hide();
        }
コード例 #2
0
        private void Btn_giris_Click_1(object sender, EventArgs e)
        {
            string tc      = mtb_tc.Text;
            string sifre   = txt_sifre.Text;
            int    admin   = db.Admins.Count(a => a.TC == tc && a.sifre == sifre);
            int    musteri = db.Musterilers.Count(m => m.TC == tc && m.Sifre == sifre);

            if (admin == 1)
            {
                ID = tc;
                AdminFormu adm = new AdminFormu();
                adm.Show();
                this.Hide();
            }
            else if (musteri == 1)
            {
                ID = tc;
                AracKiralama ak = new AracKiralama();
                ak.Show();
                this.Hide();
            }
            else
            {
                int hak = 0;
                hak++;
                DialogResult giris = MessageBox.Show("TC veya şifre hatalı, lütfen kontrol ediniz.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txt_sifre.Clear();
                mtb_tc.Clear();

                if (hak == 3)
                {
                    DialogResult bloke = MessageBox.Show("3 kez hatalı giriş yaptınız,sistem kapatılıyor.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
            }
        }