Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new Otomasyon());


            BiletAl biletAl = new BiletAl()
            {
                BiletId = 123
            };

            //BiletAl nesnesini Adapter sınıfımız ile Yolcubiletal tipine çeviriyoruz
            Yolcubiletal yolcubiletal = new Adapter(biletAl);
            /*Console.ReadKey(); */



            Guncelleyolcu guncelleyolcu = new Guncelleyolcu();


            // İlgili gözlemleyicimizi guncelleyolcu nesnemize ekliyoruz ki değişim sonrasında notify edebilelim.
            guncelleyolcu.Attach(new CustomerObserver());

            // Yolcu koltuğu değiştiriyoruz.
            guncelleyolcu.Koltukupdate();
            MessageBox.Show("Güncellendi");
        }
        private void BtnGirisYap_Click(object sender, EventArgs e)
        {
            try {
                SqlConnection mehmetbaglan = new SqlConnection();
                mehmetbaglan.ConnectionString = "Data Source=DESKTOP-54QD0V8\\SQLEXPRESS;Initial Catalog=ucakbiletotomasyonu;Integrated Security=True";
                mehmetbaglan.Open();
                SqlParameter prm1 = new SqlParameter("@141", txtKullaniciadi.Text);
                SqlParameter prm2 = new SqlParameter("@142", txtSifre.Text);
                string       sql  = "";
                sql = "SELECT * FROM calisan WHERE kulad = @141 AND sifre = @142";
                SqlCommand cmd = new SqlCommand(sql, mehmetbaglan);
                cmd.Parameters.Add(prm1);
                cmd.Parameters.Add(prm2);

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    lblDogrulama.Text = "Giriş Başarılı";
                    BiletAl bl = new BiletAl();
                    bl.Show();
                }
                else
                {
                    lblHata.Text = "HATA! Yanlış Kullanıcı Adı veya Şifre Girdiniz.";
                    return;
                }


                mehmetbaglan.Close();
            }

            catch (Exception ex)
            {
                exHata.Text = ex.Message;
            }
            this.Hide();
        }
Exemplo n.º 3
0
 public Adapter(BiletAl biletAl)
 {
     _biletAl = biletAl;
 }