public IHttpActionResult Add(HesapDTO model) { HesapBLL hesapBusiness = new HesapBLL(); hesapBusiness.Add(model); return(Ok()); }
public HesapDTO Map(Hesap ent) { var hesap = new HesapDTO(); hesap.hesapNo = ent.hesapNo; hesap.musteriNo = ent.musteriNo; hesap.ad = ent.Musteri.ad; hesap.soyad = ent.Musteri.soyad; hesap.hesapAcilisTarihi = ent.hesapAcilisTarihi; hesap.bakiye = ent.bakiye; hesap.ekNo = ent.ekNo; hesap.acilisPlatformID = ent.acilisPlatformID; hesap.acilisPlatformAdi = ent.AcilisPlatformu.acilisPlatformAdi; return(hesap); }
public List <HesapDTO> MapAll(IEnumerable <Hesap> model) { var hesaplar = new List <HesapDTO>(); foreach (var ent in model.ToList()) { var hesap = new HesapDTO(); hesap.hesapNo = ent.hesapNo; hesap.musteriNo = ent.musteriNo; hesap.ad = ent.Musteri.ad; hesap.soyad = ent.Musteri.soyad; hesap.hesapAcilisTarihi = ent.hesapAcilisTarihi; hesap.bakiye = ent.bakiye; hesap.ekNo = ent.ekNo; hesap.acilisPlatformID = ent.acilisPlatformID; hesap.acilisPlatformAdi = ent.AcilisPlatformu.acilisPlatformAdi; hesaplar.Add(hesap); } return(hesaplar); }
public void Add(HesapDTO model) { using (HesapRepository hesapRepo = new HesapRepository()) { try { var hesapAdet = GetByMusteriNo(model.musteriNo).Count; var hesap = new Hesap(); hesap.musteriNo = model.musteriNo; hesap.ekNo = 10 + hesapAdet; hesap.hesapNo = Convert.ToInt32(model.musteriNo.ToString() + hesap.ekNo.ToString()); hesap.hesapAcilisTarihi = model.hesapAcilisTarihi; hesap.bakiye = model.bakiye; hesap.acilisPlatformID = model.acilisPlatformID; hesapRepo.Add(hesap); } catch { throw; } } }