Ejemplo n.º 1
0
        private void kullanıcıDeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Anamenu kapat = new Anamenu();

            kapat.Close();
            GirisForm frm1 = new GirisForm();

            frm1.Show();
            this.Hide();
        }
Ejemplo n.º 2
0
        public void giris()
        {
            //kayıt
            try
            {
                if (txtkullaniciAdi.Text == "" && txtsifre.Text == "")
                {
                    MessageBox.Show("Giriş yapmak için tüm boşlukları doldurunuz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    baglanti.Open();
                    SqlCommand komut = new SqlCommand("select* from kullaniciBilgi where kullaniciAdi=@ad", baglanti);
                    komut.Parameters.AddWithValue("@ad", txtkullaniciAdi.Text);
                    SqlDataReader oku = komut.ExecuteReader();
                    while (oku.Read())
                    {
                        if (oku["kullaniciAdi"].ToString() == txtkullaniciAdi.Text && oku["sifre"].ToString() == txtsifre.Text && oku["unvan"].ToString() == "YÖNETİCİ")
                        {
                            ykullaniciAdi = txtkullaniciAdi.Text;
                            unvan         = txtunvan.Text;
                            this.Hide();

                            Form frm1 = new Anamenu();
                            frm1.Show();
                            break;
                        }
                        else if (oku["kullaniciAdi"].ToString() == txtkullaniciAdi.Text && oku["sifre"].ToString() == txtsifre.Text && oku["unvan"].ToString() == "PERSONEL")
                        {
                            ykullaniciAdi = txtkullaniciAdi.Text;
                            unvan         = txtunvan.Text;
                            this.Hide();
                            Form frm1 = new Anamenu();
                            frm1.Show();

                            break;
                        }
                        else
                        {
                            MessageBox.Show("Giriş bilgilerinizi kontrol ediniz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }

                    baglanti.Close();
                }
            }
            catch (Exception hata) { MessageBox.Show(hata.Message.ToString(), "EROR", MessageBoxButtons.OK, MessageBoxIcon.Stop); }
        }
Ejemplo n.º 3
0
        public void yetki()
        {
            Anamenu n = new Anamenu();

            n.menuStrip2.Visible = true;
        }