示例#1
0
        private void butonCikis_Click(object sender, EventArgs e)
        {
            UyeForm uyeform = new UyeForm();

            uyeform.Show();
            this.Hide();
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (kullaniciList.aktifKullanici.isAdmin)
     {
         AdminForm admin = new AdminForm();
         admin.Show();
     }
     else
     {
         UyeForm uye = new UyeForm();
         uye.Show();
     }
     this.Hide();
 }
示例#3
0
        private void butonGiriş_Click(object sender, EventArgs e)
        {
            ValidationManager validationManager = new ValidationManager();
            bool   validName         = validationManager.ValidateField(textKulAdi.Text);
            bool   validPassword     = validationManager.ValidateField(textSifre.Text);
            string validationSummary = "";

            if (!validName || !validPassword)
            {
                validationSummary      += "Boş bırakmayınız";
                labelValidation.Text    = validationSummary;
                labelValidation.Visible = true;
                return;
            }
            else
            {
                labelValidation.Text    = "";
                labelValidation.Visible = false;
            }
            bool giris = false;

            foreach (var item in kullaniciList.kullaniciListe)
            {
                if (item.kullaniciAdi == textKulAdi.Text && item.sifre == textSifre.Text)
                {
                    kullaniciList.aktifKullanici = item;
                    giris = true;
                    break;
                }
            }
            if (giris)
            {
                if (kullaniciList.aktifKullanici.isAdmin)
                {
                    AdminForm adminForm = new AdminForm();
                    adminForm.Show();
                }
                else
                {
                    UyeForm uyeForm = new UyeForm();
                    uyeForm.Show();
                }
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı Giriş yaptınız.");
            }
        }