コード例 #1
0
        private void KullaniciKayitButton_Click(object sender, EventArgs e)
        {
            db           connect = new db();
            MySqlCommand kmt     = new MySqlCommand();

            if (KullaniciKayitSifreTextBox.Text.Equals(SifreTekrarTextBox.Text))
            {
                kmt.Connection  = connect.baglan();
                kmt.CommandText = "insert into girisbilgikullanici (KullaniciAdi,Sifre) values ('" + KullaniciKayitIDTextBox.Text + "','" + KullaniciKayitSifreTextBox.Text + "')";
                object sonuc = null;
                sonuc = kmt.ExecuteNonQuery();
                if (sonuc != null)
                {
                    MessageBox.Show("Sisteme başarıyla eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    GirisEkran giris = new GirisEkran();
                    this.Hide();
                    giris.Show();
                }
                else
                {
                    MessageBox.Show("Sisteme eklenemedi.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                kmt.Connection = connect.kapat();
            }
            else
            {
                MessageBox.Show("Girilen Şifreler Birbiri İle Uyuşmuyor !");
            }
        }
コード例 #2
0
        private void AdminGirisButton_Click(object sender, EventArgs e)
        {
            db              connect = new db();
            MySqlCommand    kmt     = new MySqlCommand();
            MySqlDataReader dr;

            kmt.Connection  = connect.baglan();
            kmt.CommandText = "Select * FROM girisbilgikullanici where KullaniciAdi = '" + KullaniciAdiTextBox.Text + "' AND Sifre = '" + KullaniciSifreTextBox.Text + "'";
            dr = kmt.ExecuteReader();
            if (dr.Read())
            {
                MessageBox.Show("Giriş Başarılı \nAktarılıyorsunuz ...");
                ad    = dr[1].ToString();
                adres = dr[3].ToString();
                Store store = new Store();
                this.Hide();
                store.Show();
            }
            else
            {
                MessageBox.Show("Hatalı Kullanıcı Adı veya Şifre Girdiniz !");
            }


            kmt.Connection = connect.kapat();
        }
コード例 #3
0
 public void dbveri()
 {
     txtID.Text           = "";
     txtKullaniciAdi.Text = "";
     txtSifre.Text        = "";
     datatb.Clear();
     LabelTarih.Text       = "";
     kmt.Connection        = connect.baglan();
     kmt.CommandText       = "select * from girisbilgikullanici";
     adapter.SelectCommand = kmt;
     adapter.Fill(datatb);
     data.DataSource            = datatb;
     data.RowHeadersVisible     = false;
     LabelTarih.Text            = DateTime.Now.ToShortDateString();
     data.SelectionMode         = DataGridViewSelectionMode.FullRowSelect;
     data.AllowUserToAddRows    = false;
     data.AllowUserToDeleteRows = false;
     data.ReadOnly  = true;
     kmt.Connection = connect.kapat();
 }
コード例 #4
0
        public Store()
        {
            InitializeComponent();

            kmt.Connection        = connect.baglan();
            kmt.CommandText       = "select * from ürünler";
            adapter.SelectCommand = kmt;
            adapter.Fill(datatable);
            DATA.DataSource = datatable;
            kmt.Connection  = connect.kapat();
        }
コード例 #5
0
 public void dbveri()
 {
     Pic.ImageLocation  = "";
     txtId.Text         = "";
     txtUrunAdi.Text    = "";
     txtUrunFiyati.Text = "";
     txtStok.Text       = "";
     txtPic.Text        = "";
     txtAgirlik.Text    = "";
     datatb.Clear();
     LabelTarih.Text       = "";
     kmt.Connection        = connect.baglan();
     kmt.CommandText       = "select * from ürünler";
     adapter.SelectCommand = kmt;
     adapter.Fill(datatb);
     data.DataSource            = datatb;
     data.RowHeadersVisible     = false;
     LabelTarih.Text            = DateTime.Now.ToShortDateString();
     data.SelectionMode         = DataGridViewSelectionMode.FullRowSelect;
     data.AllowUserToAddRows    = false;
     data.AllowUserToDeleteRows = false;
     data.ReadOnly  = true;
     kmt.Connection = connect.kapat();
 }
コード例 #6
0
        private void AdminGirisButton_Click(object sender, EventArgs e)
        {
            db              connect = new db();
            MySqlCommand    kmt     = new MySqlCommand();
            MySqlDataReader dr;

            kmt.Connection  = connect.baglan();
            kmt.CommandText = "Select * FROM girisbilgi where KullaniciAdi = '" + AdminIsimTextBox.Text + "' AND Sifre = '" + AdminSifreTextBox.Text + "'";
            dr = kmt.ExecuteReader();
            if (dr.Read())
            {
                MessageBox.Show("Giriş Başarılı \nAktarılıyorsunuz ...");
                this.Hide();
                YönetimPaneli panel = new YönetimPaneli();
                panel.Show();
            }
            else
            {
                MessageBox.Show("Hatalı Kullanıcı Adı veya Şifre Girdiniz !");
            }
            kmt.Connection = connect.kapat();
        }
コード例 #7
0
        public void girissorgula()
        {
            db              connect = new db();
            MySqlCommand    kmt     = new MySqlCommand();
            MySqlDataReader dr;

            kmt.Connection  = connect.baglan();
            kmt.CommandText = "Select * FROM kredikart where KartNo = '" + txtKartNo.Text + "' AND KartTip = '" + txtKartType.Text + "' AND sktt = '" + txtKartSKTT.Text + "'";
            dr = kmt.ExecuteReader();
            if (dr.Read())
            {
                MessageBox.Show("ÖDEME BAŞARILI", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CashForm.kontrol = true;
                this.Hide();
                Store store = new Store();
                store.Show();
            }
            else
            {
                MessageBox.Show("Bilgiler yanlış !", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            kmt.Connection = connect.kapat();
        }
コード例 #8
0
        public void dbveri()
        {

            urundatalabel.Text = "";
            urunfiyatdatalabel.Text = "";
            urunstokdatalabel.Text = "";
            datatable.Clear();
            tarihlabel.Text = "";
            kmt.Connection = connect.baglan();
            kmt.CommandText = "select * from ürünler";
            adapter.SelectCommand = kmt;
            adapter.Fill(datatable);
            DATA.DataSource = datatable;
            DATA.RowHeadersVisible = false;
            tarihlabel.Text = DateTime.Now.ToShortDateString();
            DATA.Columns[0].Visible = false;
            DATA.Columns[4].Visible = false;
            DATA.Columns[5].Visible = false;
            DATA.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            DATA.AllowUserToAddRows = false;
            DATA.AllowUserToDeleteRows = false;
            DATA.ReadOnly = true;
            kmt.Connection = connect.kapat();
        }