コード例 #1
0
        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;
        }
コード例 #2
0
        public ActionResult Delete(int id)
        {
            CinemaFeature cineamFeature = _cinemaFeatureService.Find(id);

            if (cineamFeature != null)
            {
                if (_cinemaFeatureService.Delete(cineamFeature) != null)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(RedirectToAction("Index"));
        }
コード例 #3
0
        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"));
        }
コード例 #4
0
 public CinemaFeature Delete(CinemaFeature cinemaFeature)
 {
     return(_cinemaFeatureRepository.Delete(cinemaFeature));
 }
コード例 #5
0
 public CinemaFeature Add(CinemaFeature cinemaFeature)
 {
     return(_cinemaFeatureRepository.Add(cinemaFeature));
 }