예제 #1
0
        private void btnlLogin_Click(object sender, EventArgs e)
        {
            using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
            {
                string currentnick = db.Users.Where(k => k.UserNickname == txtNick.Text && k.UserPassword == txtPass.Text).Select(s => s.UserNickname).FirstOrDefault();
                string currentpass = db.Users.Where(k => k.UserNickname == txtNick.Text && k.UserPassword == txtPass.Text).Select(s => s.UserPassword).FirstOrDefault();
                if (currentnick == txtNick.Text && currentpass == txtPass.Text)
                {
                    int rol = db.Users.Where(k => k.UserNickname == txtNick.Text && k.UserPassword == txtPass.Text).Select(s => s.UserRole).FirstOrDefault().Value;
                    if (rol == 1)
                    {
                        frmMusteri musteri = new frmMusteri(txtNick.Text, this);
                        musteri.Show();
                    }
                    else if (rol == 2)
                    {
                        frmYonetici yonetici = new frmYonetici(txtNick.Text, this);
                        yonetici.Show();
                    }
                    else if (rol > 2)
                    {
                        Log.Giris(txtNick.Text, db.Users.Where(k => k.UserNickname == txtNick.Text).Select(s => s.UsersID).FirstOrDefault());

                        frmCalisan calisan = new frmCalisan(txtNick.Text, this);
                        Log.LogEkle("\n<< Çalışan Ekranına Girildi >>\n");
                        calisan.Show();
                    }
                }

                else
                {
                    MessageBox.Show("Böyle Bir Kullanıcı Yok");
                }
            }
        }
예제 #2
0
        private void btnGeri_Click(object sender, EventArgs e)
        {
            this.Close();
            YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1();
            string      kad  = db.Users.Where(k => k.UsersID == kID).Select(u => u.UserNickname).FirstOrDefault();
            frmYonetici yntc = new frmYonetici(kad);

            yntc.Show();
        }