Exemple #1
0
 private void btnTopluSilme_Click(object sender, EventArgs e)
 {
     GetServiceInstances();
     try
     {
         foreach (var item in _hisseSenediService.GetAll().Where(p => p.HisseYili == (int)nudHisseYiliAra.Value && p.HisseTertipNo == (int)nudTertipNoAra.Value).ToList())
         {
             foreach (var karp in _karPayiPuluService.GetAll().Where(x => x.HisseSenediID == item.ID))
             {
                 _karPayiPuluService.Delete(karp);
             }
             foreach (var yenip in _yeniPayPuluService.GetAll().Where(y => y.HisseSenediID == item.ID))
             {
                 _yeniPayPuluService.Delete(yenip);
             }
             _hisseSenediService.Delete(item);
         }
         MessageBox.Show("Silme Başarılı");
     }
     catch (Exception)
     {
         MessageBox.Show("Silme Başarısız");;
     }
 }
 private void LoadDGWs()
 {
     dgwKar.DataSource  = _karPayiPuluService.GetAll().Where(p => p.HisseSenediID == _hisseSenedi.ID).ToList();
     dgwYeni.DataSource = _yeniPayPuluService.GetAll().Where(p => p.HisseSenediID == _hisseSenedi.ID).ToList();
 }