Ejemplo n.º 1
0
        private void btnGuncelle_Click(object sender, EventArgs e)
        {
            DB db = new DB();

            try
            {
                _sifreTut.KullaniciAdi = txtNick.Text;
                _sifreTut.Not          = txtNot.Text;
                _sifreTut.Sifre        = Sifreleme.sifrele(txtSifre.Text);
                db.Update(_sifreTut);
                this.Close();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
        private void buttonEkle_Click(object sender, EventArgs e)
        {
            DB db = new DB();

            try
            {
                string   sifre    = Sifreleme.sifrele(textBoxSifre.Text);
                sifreTut sifreTut = new sifreTut {
                    Sifre = sifre, KullaniciAdi = textBoxNick.Text, Not = txtNot.Text
                };
                db.Add(sifreTut);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }

            FrmAnasayfa frmAnasayfa = (FrmAnasayfa)Application.OpenForms["FrmAnasayfa"];

            panel.Controls.Clear();
            frmAnasayfa.listele();
            this.Close();
        }