Beispiel #1
0
        public IActionResult SearchById(int id)
        {
            var movies = MovieData.FilterData(id);

            if (movies.Count != 0)
            {
                return(PartialView("~/Views/Movie/_FilterMovieDetailsPartial.cshtml", movies));
            }

            else
            {
                return(PartialView("~/Views/Movie/_EmptyPartial.cshtml"));
            }
        }
Beispiel #2
0
        public IActionResult DeleteView(int Id)
        {
            if (Id == 0)
            {
                return(PartialView("~/Views/Movie/_WrongInsertion.cshtml"));
            }
            var select = MovieData.FilterData(Id);

            if (select.Count == 0)
            {
                return(PartialView("~/Views/Movie/_EmptyPartial.cshtml"));
            }
            var Data = MovieData.DeleteData(Id);

            return(PartialView("~/Views/Movie/_FilterMovieDetailsPartial.cshtml", Data));
        }
Beispiel #3
0
        public IActionResult UpdateView(MovieModel model)
        {
            var MovieId     = model.MovieId;
            var MovieName   = model.MovieName;
            var ReleaseYear = model.ReleaseYear;
            var Genre       = model.Genre;

            if (model.MovieId == 0 || model.MovieName == null || model.ReleaseYear == null || model.Genre == null)
            {
                return(PartialView("~/Views/Movie/_WrongInsertion.cshtml"));
            }
            var select = MovieData.FilterData(MovieId);

            if (select.Count == 0)
            {
                return(PartialView("~/Views/Movie/_EmptyPartial.cshtml"));
            }
            var Data = MovieData.UpdateData(MovieId, model);

            return(PartialView("~/Views/Movie/_FilterMovieDetailsPartial.cshtml", Data));
        }