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); } }
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); } }
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); } }
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); } }
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); } }
public OdemeBLL() { _odemeRepository = new OdemeRepository(); }