public void Add(SacrificePriceViewModel viewModel)
        {
            _repository.Add(new SacrificePrice
            {
                CreationDate = DateTime.Now,
                IsItDeleted  = false,
                Status       = true,

                Price = viewModel.Price
            });
        }
        public void Update(SacrificePriceViewModel viewModel)
        {
            var sacrificeprice = _repository.Get(x => x.Id == viewModel.Id);

            sacrificeprice.Status       = viewModel.Status;
            sacrificeprice.DateOfUpdate = DateTime.Now;
            sacrificeprice.IsItDeleted  = viewModel.IsItDeleted;

            sacrificeprice.Price = viewModel.Price;
            _repository.Update(sacrificeprice);
        }
예제 #3
0
 public ActionResult SacrificeDonatePriceSave(SacrificePriceViewModel viewModel)
 {
     SessionKontrol();
     if (_users != null)
     {
         _SacrificePriceServices.Update(viewModel);
         _unitOfWork.SaveChanges();
         return(RedirectToAction("SacrificeDonatePrice", "Donation"));
     }
     else
     {
         return(RedirectToAction("Index", "Login"));
     }
 }