private void dGridListe_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            baglanti     bag      = new baglanti();
            DialogResult teslimal = new DialogResult();

            teslimal = MessageBox.Show("Teslim Almak İstediğinize Emin misiniz?", "Teslim Alınsın mı?", MessageBoxButtons.YesNo);
            if (teslimal == DialogResult.Yes)
            {
                try
                {
                    bag.teslimAlma(Convert.ToInt32(dGridListe.Rows[e.RowIndex].Cells[0].Value), DateTime.Now);
                }
                catch (Exception)
                {
                    MessageBox.Show("Hata");
                }
                dGridListe.Update();
                dGridListe.Refresh();
            }
        }
示例#2
0
        private void btnAdminKayit_Click(object sender, EventArgs e)
        {
            baglanti con = new baglanti();

            if (resimYol == null)
            {
                MessageBox.Show("Lütfen Bir Fotoğraf Seçiniz");
            }
            FileStream   fs = new FileStream(resimYol, FileMode.Open, FileAccess.Read);
            BinaryReader br = new BinaryReader(fs);

            byte[] resim = br.ReadBytes((int)fs.Length);
            br.Close();
            fs.Close();
            con.adminEkle(txtKadi.Text, txtParola.Text, txtAd.Text, txtSoyad.Text, resim);
            txtKadi.Clear();
            txtParola.Clear();
            txtAd.Clear();
            txtSoyad.Clear();
            picBoxResim.Hide();
        }
        private void btnKullaniciGiris_Click(object sender, EventArgs e)
        {
            baglanti db = new baglanti();

            try
            {
                RegistryKey register = Registry.CurrentUser;
                register = register.OpenSubKey("", true);
                string ad            = (string)register.GetValue("ad");
                int    oturum_sayisi = Convert.ToInt32(register.GetValue("oturum")) + 1;
                register.SetValue("oturum", oturum_sayisi);
                MessageBox.Show("Hoşgeldin " + ad + " Programı " + oturum_sayisi + " kez açtınız");
            }
            catch (Exception)
            {
                RegistryKey register = Registry.CurrentUser;
                register = register.CreateSubKey("");
                register.SetValue("ad", "");
                register.SetValue("Oturum", 1);
                MessageBox.Show("Oturumu ilkez açtınız");
            }
            string kuladi = txtKullaniciAdi.Text.ToString();
            string parola = txtKullaniciParola.Text.ToString();
            bool   giris  = db.kullaniciGirisKontrol(kuladi, parola);

            if (giris == true)
            {
                AnaEkran ana = new AnaEkran();
                ana.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Hatalı Giriş");
            }
        }