Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmBilet frm = new frmBilet();

            frm.label1.Text = label1.Text;
            frm.Show();
            Hide();
        }
        private void btn_giris_Click_1(object sender, EventArgs e)
        {
            if (textBox2.Text != "")
            {
                label2.ForeColor = Color.Lime;
            }
            else
            {
                return;
            }
            tbKullanicilar k = ent.tbKullanicilar.Where(x => x.kullanici_adi == textBox1.Text && x.kullanici_sifresi == textBox2.Text).SingleOrDefault();

            if (k == null)
            {
                label2.ForeColor = Color.Red;
                label1.ForeColor = Color.Red;
                MessageBox.Show("KULLANICI BULUNAMADI\n LÜTFEN KULLANICI ADINIZI ŞİFRENİZİ DOĞRU YAZINIZ", "HATA", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (k != null)
            {
                frmBilet frm  = new frmBilet();
                Form2    frm2 = new Form2();

                adi.ad = k.kullanici_adi;
                if (k.kullanici_admin == true)
                {
                    frm2.label1.Text = "HOŞ  GELDİNİZ  SAYIN " + k.kullanici_ad_soyad.ToUpper() + "  " + DateTime.Now;

                    frm2.Show();
                    this.Hide();
                }
                else if (k.kullanici_admin == false)
                {
                    frm.button51.Visible = false;
                    frm.label1.Text      = "HOŞ  GELDİNİZ  " + k.kullanici_ad_soyad.ToUpper() + "  " + DateTime.Now;
                    frm.Show();
                    this.Hide();
                }
            }
        }