public ActionResult addFilmEpisode(string id) { var filmDao = new FilmDAO(); ViewBag.filmBo = filmDao.getFilmByID(id); ViewData["episodeNow"] = filmDao.getFilmByID(id).releasedEpisodes + 1; return(View()); }
public ActionResult Edit(string id) { var filmDao = new FilmDAO(); var filmDetail = filmDao.getFilmByID(id); DateTime format = (DateTime)filmDetail.releaseFilm; var formatDT = format.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); //var dt = filmDetail.releaseFilm.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture); ViewBag.filmDetail = filmDetail; ViewBag.dt = formatDT; //ViewBag.dt = formatDT; //DateTime dt = (DateTime)filmDetail.releaseFilm; //ViewBag.dateadd = convertToString(dt); return(View()); }
public ActionResult FilmBoInformation(string id) { var filmDao = new FilmDAO(); var feedbackDao = new FeedbackDAO(); var filmEpDao = new FilmEpisodeDAO(); var filmModel = filmDao.getFilmByID(id); var feedBackListModel = feedbackDao.listAll(filmModel.filmID); var FeedbackOfAcc = feedbackDao.listAccountFB(filmModel.filmID); ViewBag.filmDetail = filmModel; ViewBag.filmFeedBack = feedBackListModel; ViewBag.FeedBackOfAcc = FeedbackOfAcc; ViewBag.filmEpisode = filmEpDao.ListAllEpisodeRelease(filmModel.filmID); return(View()); }
public ActionResult FilmLeInformation(string id) { var filmDao = new FilmDAO(); var epDao = new FilmEpisodeDAO(); var feedbackDao = new FeedbackDAO(); var filmModel = filmDao.getFilmByID(id); var Epfilm = epDao.getEpFilmLeByFilmID(id); var feedBackListModel = feedbackDao.listAll(filmModel.filmID); var FeedbackOfAcc = feedbackDao.listAccountFB(filmModel.filmID); ViewBag.filmDetail = filmModel; ViewBag.EpDetail = Epfilm; ViewBag.filmFeedBack = feedBackListModel; ViewBag.FeedBackOfAcc = FeedbackOfAcc; return(View()); }
public ActionResult Edit(Film film) { try { var filmDao = new FilmDAO(); var oldFilm = filmDao.getFilmByID(film.filmID); foreach (PropertyInfo propertyInfo in film.GetType().GetProperties()) { propertyInfo.SetValue(oldFilm, propertyInfo.GetValue(film)); } filmDao.dbFilmContext.SaveChanges(); return(RedirectToAction("Films")); } catch { return(View()); } }
public ActionResult addFilmEpisode(FilmEpisode ep) { int res = new FilmEpisodeDAO().CreateTapPhim(ep); string message = "SUCCESS"; if (res > 0) { var filmBoID = ep.filmID; var filmDao = new FilmDAO(); var inforFilm = filmDao.getFilmByID(filmBoID); inforFilm.releasedEpisodes = inforFilm.releasedEpisodes + 1; filmDao.dbFilmContext.SaveChanges(); return(Json(new { Message = message, JsonRequestBehavior.AllowGet })); } message = "Failed"; return(Json(new { Message = message })); }
// GET: DetailFilm public ActionResult Detail(string id) { var filmDao = new FilmDAO(); var feedbackDao = new FeedbackDAO(); var filmModel = filmDao.getFilmByID(id); var feedBackListModel = feedbackDao.listAll(filmModel.filmID); var FeedbackOfAcc = feedbackDao.listAccountFB(filmModel.filmID); int numrecords = 10; ViewBag.listfilmDescendingbyCreateDate = filmDao.listFilmSlideDescendingbyCreateDate(numrecords); ViewBag.filmDetail = filmModel; ViewBag.filmFeedBack = feedBackListModel; ViewBag.FeedBackOfAcc = FeedbackOfAcc; return(View()); }
public ActionResult chairStatus(int filmID, int timeslotID) { var chairDAO = new ChairDAO(); var filmDAO = new FilmDAO(); var showtimeDAO = new ShowTimeDAO(); var userDAO = new UserDAO(); List <Chair> chair = db.Chairs.ToList(); List <Chair> chairSelected = chairDAO.getChairSelected2(filmID, timeslotID).ToList(); Film f = filmDAO.getFilmByID(filmID); ViewBag.film = f; ShowTimes s = showtimeDAO.getShowtime(filmID, timeslotID); ViewBag.showtime = s; TimeSlot t = showtimeDAO.getTimebyID(timeslotID); ViewBag.timeslot = t.Time; var userLogin = (UserLogin)Session[CommonConstants.USER_SESSION]; ViewBag.userLogged = userDAO.getUserById(userLogin.UserID); foreach (var c in chair) { foreach (var cs in chairSelected) { if (c.ChairID == cs.ChairID) { c.Status = true; } } } ViewBag.chair = chair; return(View()); }
public ActionResult Detail(int id) { var dao = new FilmDAO(); return(View(dao.getFilmByID(id))); }