public static void UpdateCinemaFeature(this CinemaFeature cinemaFeature, CinemaFeatureViewModel cinemaFeatureViewModel) { //cinemaFeature.FeatureID = cinemaFeatureViewModel.FeatureID; cinemaFeature.FeatureType = cinemaFeatureViewModel.FeatureType; cinemaFeature.FeatureContent = cinemaFeatureViewModel.FeatureContent; cinemaFeature.FeatureDescription = cinemaFeatureViewModel.FeatureDescription; cinemaFeature.CreatedDate = cinemaFeatureViewModel.CreatedDate; cinemaFeature.CreatedBy = cinemaFeatureViewModel.CreatedBy; cinemaFeature.UpdatedDate = cinemaFeatureViewModel.UpdatedDate; cinemaFeature.UpdatedBy = cinemaFeatureViewModel.UpdatedBy; cinemaFeature.MetaKeyword = cinemaFeatureViewModel.MetaKeyword; cinemaFeature.MetaDescription = cinemaFeatureViewModel.MetaDescription; }
public ActionResult Delete(int id) { CinemaFeature cineamFeature = _cinemaFeatureService.Find(id); if (cineamFeature != null) { if (_cinemaFeatureService.Delete(cineamFeature) != null) { return(RedirectToAction("Index")); } } return(RedirectToAction("Index")); }
public ActionResult Create(CinemaFeatureViewModel cinemaFeatureViewModel) { if (ModelState.IsValid) { cinemaFeatureViewModel.CreatedDate = DateTime.Now; CinemaFeature cinemaFeature = new CinemaFeature(); cinemaFeature.UpdateCinemaFeature(cinemaFeatureViewModel); if (cinemaFeature != null) { _cinemaFeatureService.Add(cinemaFeature); _cinemaFeatureService.SaveChanges(); return(RedirectToAction(("Index"))); } } return(RedirectToAction("Create")); }
public CinemaFeature Delete(CinemaFeature cinemaFeature) { return(_cinemaFeatureRepository.Delete(cinemaFeature)); }
public CinemaFeature Add(CinemaFeature cinemaFeature) { return(_cinemaFeatureRepository.Add(cinemaFeature)); }