public string AddMovie(string MovieName,string DirectorName,string GenreName,int Rating, int Duration,int DVDcopy,int Cost) { if (ModelState.IsValid) { MoviesDetails dalObj = new MoviesDetails(); MovieDetailModel movieObject = new MovieDetailModel(); movieObject = dalObj.AddMovie(MovieName,DirectorName,GenreName,Rating,Duration,DVDcopy,Cost); if (movieObject != null) { ViewBag.Message = "MovieId" + movieObject.MovieID; return movieObject.MovieID.ToString(); } } return "false"; }
public string AddGenre(string GenreNameInput) { if (ModelState.IsValid) { MoviesDetails dalObj = new MoviesDetails(); MovieDetailModel genreObject = new MovieDetailModel(); genreObject = dalObj.AddMovieGenres(GenreNameInput); if (genreObject != null) { ViewBag.Message = "GenreId" + genreObject.DirectorGenerID; return genreObject.DirectorGenerID.ToString(); } } return "false"; }
public string AddDirector(string DirectorFirstName, string DirectorLastName) { if (ModelState.IsValid) { MoviesDetails DalObj = new MoviesDetails(); MovieDetailModel DirObject = new MovieDetailModel(); DirObject=DalObj.AddMovieDirectors(DirectorFirstName, DirectorLastName); if (DirObject.DirectorGenerID != -1) { ViewBag.Message = "DirectorId" + DirObject.DirectorGenerID; } else { ViewBag.Messgae = "-1"; } return DirObject.DirectorGenerID.ToString(); } return "false"; }
public ActionResult Index(string DirectorFirstName, string DirectorLastName) { if (ModelState.IsValid) { MoviesDetails DalObj = new MoviesDetails(); MovieDetailModel DirObject = new MovieDetailModel(); DirObject=DalObj.AddMovieDirectors(DirectorFirstName, DirectorLastName); if (DirObject!=null) { if (DirObject.DataError == null) { ViewBag.message = "Director ID " + DirObject.DirectorGenerID; } else { ViewBag.message ="-1"; } return View(); } } return View(); }
public ActionResult Index() { if (Session["UserID"] != null) { if (Session["Role"].Equals("member")) { return RedirectToAction("Index", "Member"); } } else { return RedirectToAction("Login", "Account"); } MoviesDetails dalObjDirList = new MoviesDetails(); List<string> directorList = new List<string>(); //list.Add(new string(dalObjDirList.DirectorNameList())); directorList = dalObjDirList.DirectorNameList(); MoviesDetails dalObjGenreList = new MoviesDetails(); List<string> genreList = new List<string>(); genreList = dalObjGenreList.GenreNameList(); //if (directorList!=null) //{ // ViewData["DirectorNameList"] = directorList; //} //if(genreList!=null) //{ // ViewData["GenreNameList"] = genreList; //} //ViewBag.DirectorNameList = dalObjDirList.DirectorNameList(); //ViewBag.GenreNameList = dalObjGenreList.GenreNameList(); ViewBag.DirectorNameList = directorList; ViewBag.GenreNameList = genreList; return View(); }