public SubscriberService(UnitofWork uow) { _uow = uow; _aboneRepo = _uow.GetRepository <Abone>(); _aboneDTO = new AboneDTO(); _giriscikisRepo = _uow.GetRepository <AboneGiriCikis>(); _giriscikisDTO = new AboneGirisCikisDTO(); _odemeRepo = _uow.GetRepository <AboneOdeme>(); _odemeDTO = new AboneOdemeDTO(); }
public void SubscriberPaymentInsert(AboneOdemeDTO odeme) { try { var entity = AutoMapper.Mapper.DynamicMap <AboneOdeme>(odeme); _odemeRepo.Insert(entity); _uow.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ActionResult SubscriberPaymentInsert(AboneOdemeDTO odeme) { odeme.OdemeTarihi = DateTime.Now; _aboneService.SubscriberPaymentInsert(odeme); GelirlerDTO gelir = new GelirlerDTO(); gelir.GelirTuru = "Abone Ödeme"; gelir.OdemeTarihi = Convert.ToDateTime(odeme.OdemeTarihi); gelir.Tutar = Convert.ToDecimal(odeme.Tutar); var abone = _aboneService.Subscriber(Convert.ToInt32(odeme.AboneID)); gelir.AracID = Convert.ToInt32(abone.AracID); _gelirService.Insert(gelir); return(RedirectToAction("SubscriberList", "Subscriber")); }