Пример #1
0
        public bool BorcOde(int AboneNo, string HesapNo)
        {
            var repo2 = new HesapRepository();

            try
            {
                using (var repo = new OdemeRepository())
                {
                    Odeme o      = repo.AboneNoSec(AboneNo);
                    Hesap h      = repo2.HesapNoSec(HesapNo);
                    var   bakiye = h.Bakiye;
                    var   borc   = o.Borc;
                    if (borc > 0 && borc <= bakiye)
                    {
                        bakiye -= borc;
                        borc    = 0;
                        repo2.HesapBakiyeGuncelle(h.HesapID, bakiye);
                        repo.BorcOde(AboneNo);

                        return(true);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                throw new Exception("OdemeBusiness:OdemeRepository:Ödeme Hatası", ex);
            }
        }
Пример #2
0
 public Odeme AboneNoSec(int AboneNo)
 {
     try
     {
         Odeme responseEntitiy = null;
         using (var repo = new OdemeRepository())
         {
             responseEntitiy = repo.AboneNoSec(AboneNo);
         }
         return(responseEntitiy);
     }
     catch (Exception ex)
     {
         throw new Exception("OdemeBusiness:OdemeBusiness:Seçme Hatası", ex);
     }
 }
Пример #3
0
 public Odeme OdemeIdSil(int OdemeId)
 {
     try
     {
         using (var repo = new OdemeRepository())
         {
             if (repo.IdSil(OdemeId))
             {
                 return(repo.IdSec(OdemeId));
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         throw new Exception("OdemeBusiness:OdemeRepository:Silme Hatası", ex);
     }
 }
Пример #4
0
 public Odeme OdemeGuncelle(Odeme entity)
 {
     try
     {
         using (var repo = new OdemeRepository())
         {
             if (repo.Guncelle(entity))
             {
                 return(entity);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         throw new Exception("OdemeBusiness:OdemeRepository:Güncelleme Hatası", ex);
     }
 }
Пример #5
0
        public List <Odeme> OdemeHepsiniSec()
        {
            var responseEntities = new List <Odeme>();

            try
            {
                using (var repo = new OdemeRepository())
                {
                    foreach (var entity in repo.HepsiniSec())
                    {
                        responseEntities.Add(entity);
                    }
                }
                return(responseEntities);
            }
            catch (Exception ex)
            {
                throw new Exception("OdemeBusiness:OdemeRepository:Hepsini Seçme Hatası", ex);
            }
        }
Пример #6
0
 public OdemeBLL()
 {
     _odemeRepository = new OdemeRepository();
 }