Exemple #1
0
        public ActionResult CustomerPaymentInsert(MusteriParkDTO park)
        {
            DateTime bas   = Convert.ToDateTime(park.GirisTarihi);
            DateTime son   = Convert.ToDateTime(park.CikisTarihi);
            var      fark  = (son - bas).Hours;
            var      fiyat = fark * 10;

            MusteriDTO musteri = _musteriService.Customer(park.MusteriID);

            musteri.Tutar = fiyat;
            musteri.Durum = false;

            bool durum = _musteriService.CustomerUpdate(musteri);

            if (durum == true)
            {
                bool parkdurum = _musteriService.CustomerParkUpdate(park);
                if (parkdurum == true)
                {
                    GelirlerDTO gelir = new GelirlerDTO();
                    gelir.GelirTuru   = "Müsteri Park Ödeme";
                    gelir.OdemeTarihi = Convert.ToDateTime(park.CikisTarihi);
                    gelir.Tutar       = Convert.ToDecimal(fiyat);
                    gelir.AracID      = Convert.ToInt32(musteri.AracId);
                    _gelirService.Insert(gelir);
                }
            }
            return(RedirectToAction("CustomerList", "Customer"));
        }
 public void Insert(GelirlerDTO gelir)
 {
     try
     {
         var entity = AutoMapper.Mapper.DynamicMap <Gelirler>(gelir);
         _gelirRepo.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"));
        }
 public MoneyEntryService(UnitofWork uow)
 {
     _uow       = uow;
     _gelirRepo = _uow.GetRepository <Gelirler>();
     _gelirDTO  = new GelirlerDTO();
 }