public ParolaEdit(Parola parola, Operations enumOperationName) { InitializeComponent(); _parola = parola; _enumOperationName = enumOperationName; bll = InstanceFactory.GetInstance <IParolaService>(); CreateSimpleButton(_enumOperationName); }
private void Btn_Update_Click(object sender, EventArgs e) { //Guncelleme işlemi Hata.tryCatch(() => { Parola newParola = NewParola(); if (_enumOperationName == Operations.Update) { bll.Update(newParola); } else if (_enumOperationName == Operations.Add) { bll.Add(newParola); } else if (_enumOperationName == Operations.Delete) { bll.Delete(newParola); } if (_enumOperationName != Operations.Delete) { Form form1 = Application.OpenForms["Anasayfa"]; ((TextBox)form1.Controls["txtArama"]).Text = " "; ((TextBox)form1.Controls["txtArama"]).Text = newParola.isim; List <Parola> parolalar = bll.GetAll(); GroupBox liste = form1.Controls["grpbxListe"] as GroupBox; Label kayitSayisi = liste.Controls["lblToplamKayitSayisi"] as Label; kayitSayisi.Text = parolalar.Count.ToString(); } else { Form frm = Application.OpenForms["Anasayfa"]; bll = InstanceFactory.GetInstance <IParolaService>(); GroupBox grpbx = frm.Controls["grpbxListe"] as GroupBox; ListBox lstbox = grpbx.Controls["lblParolaListe"] as ListBox; List <Parola> parolalar = bll.GetAll(); lstbox.DataSource = parolalar; Label kayitSayisi = grpbx.Controls["lblToplamKayitSayisi"] as Label; kayitSayisi.Text = parolalar.Count.ToString(); } this.Close(); }); }
public datagridliste() { InitializeComponent(); _bll = InstanceFactory.GetInstance <IParolaService>(); }
public Anasayfa() { InitializeComponent(); parolaEntity = lblParolaListe.SelectedItem as Parola; _bll = InstanceFactory.GetInstance <IParolaService>(); }