Пример #1
0
        public void veri_kaydet(string kullanici_adi, string e_posta, string sifre)
        {
            hashsifre = hashleme(sifre);    // öncelikle hashleme
            hashsifre = tuzlama(hashsifre); // sonra tuzlama yaptım
            baglanti.Open();
            SqlCommand yeniveri = new SqlCommand("insert into bilgiler (kullanici_adi,e_posta,sifre) values ( '" + kullanici_adi + "','" + e_posta + "','" + hashsifre + "')", baglanti);

            yeniveri.ExecuteNonQuery();//  veri tabanına değrlri yazdım
            MessageBox.Show("Kayıt BAŞARILIIIIIIIII..........");
            Form1 form1 = new Form1();

            form1.Show();
            Form2 form2 = new Form2();

            form2.Close();
        }
Пример #2
0
        private void đặtVéToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form2 f = new Form2();

            while (f.ShowDialog() == DialogResult.OK)
            {
                if (f.getTB1() == "" || f.getTB2() == "" || f.getTB3() == "" || f.getTB5() == "" || f.getTB6() == "" || (f.getCB2() == false && f.getCB1() == false))
                {
                    MessageBox.Show("Chưa điền đủ thông tin", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                string a       = f.getTB5();
                int    id      = Convert.ToInt32(f.getTB6());
                string cmnd    = f.getTB1();
                string name    = f.getTB3();
                string surname = f.getTB2();
                string sex;
                if (f.getCB2() == true)
                {
                    sex = "male";
                }
                else
                {
                    sex = "female";
                }
                if (check_ticket_booked(obj, a, id) == true)
                {
                    MessageBox.Show("Vé đã được đặt", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                if (check_CMND_booked(obj, a, cmnd) == true)
                {
                    MessageBox.Show("Khách hàng đã đặt vé trên chuyến bay này", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    continue;
                }
                bookticket(obj, a, id, cmnd, name, surname, sex);
                MessageBox.Show("Đặt vé thành công", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
                f.Close();
                break;
            }
        }
Пример #3
0
        private void basla_Click(object sender, EventArgs e)
        {
            if (ilkAcilisMi == true)
            {
                sistemiBaslat();
                sureyiBaslat();
                f2 = new Form2();
                f2.Show();
                ilkAcilisMi = false;
            }
            else
            {
                DialogResult diyalog = MessageBox.Show("Yeni oyun başlatmak istediğinizden emin misiniz?", "Uyarı", MessageBoxButtons.YesNo);
                if (diyalog == DialogResult.Yes)
                {
                    sistemiBaslat();
                    for (int i = 1; i <= 25; i++)
                    {
                        Button buton = (Button)(this.Controls.Find("" + i, true)[0]);
                        buton.BackColor = Color.Gray;
                        buton.Text      = "";
                    }

                    if (f2 != null)
                    {
                        f2.Close();
                    }
                    oyunBittiMi = false;
                    sureyiBaslat();
                    f2 = new Form2();
                    f2.Show();
                }
                else if (diyalog == DialogResult.No)
                {
                }
            }
        }
Пример #4
0
        public Class1(Form2 f)
        {
            a = f;
            SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();

            builder.DataSource         = "ANTONINA";
            builder.InitialCatalog     = "testowy";
            builder.IntegratedSecurity = true;
            con = new SqlConnection(builder.ConnectionString);
            DataSet ds = new DataSet();

            con.InfoMessage += new SqlInfoMessageEventHandler(Connection_InfoMessage);
            Task task = Task.Factory.StartNew(() =>
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection     = con;
                    cmd.CommandText    = "dbo.test";
                    cmd.CommandTimeout = 120;


                    cmd.Connection.Open();

                    using (SqlDataAdapter sa = new SqlDataAdapter(cmd))
                    {
                        Task.Delay(300).Wait();
                        sa.Fill(ds);
                        cmd.Connection.Close();
                        a.Invoke((MethodInvoker) delegate()
                        {
                            a.Close();
                        });
                    }
                }
            }
                                              );
        }
Пример #5
0
 private void lbKapat_Click(object sender, EventArgs e)
 {
     this.Close();
     fm.Close();
 }
Пример #6
0
        private void Form3_FormClosing(object sender, FormClosingEventArgs e)
        {
            Form2 frm = new Form2();

            frm.Close();
        }