Beispiel #1
0
        public ActionResult UpdateTheatre(int id)
        {
            Theatre         theatre      = theatreBl.GetTheatreById(id);
            SignUpNextModel theatreModel = AutoMapper.Mapper.Map <Theatre, SignUpNextModel>(theatre);

            return(View(theatreModel));
        }
Beispiel #2
0
        public ActionResult ViewTheatre()
        {
            int             id            = (int)Session["UserId"];
            Theatre         theatreEntity = theatreBl.GetData(id);
            SignUpNextModel theatre       = AutoMapper.Mapper.Map <Theatre, SignUpNextModel>(theatreEntity);

            ViewData["Theatre"] = theatre;
            return(View(theatre));
        }
Beispiel #3
0
 public ActionResult UpdateTheatre(SignUpNextModel theatre)
 {
     if (ModelState.IsValid)
     {
         Theatre theatreEntity = AutoMapper.Mapper.Map <SignUpNextModel, Theatre>(theatre);
         theatreBl.UpdateTheatre(theatreEntity);
         return(RedirectToAction("ViewTheatre"));
     }
     return(View());
 }
 public ActionResult SignUpNext(SignUpNextModel model)          //Action method for sign up next
 {
     if (ModelState.IsValid)
     {
         model.UserId = (int)TempData["id"];
         var theatre = AutoMapper.Mapper.Map <SignUpNextModel, Theatre>(model);   //Auto mapper
         userBl.SignUpNext(theatre);
         ViewBag.message = "Registered successfully";
     }
     return(View());
 }
        public ActionResult DisplayTheatre()
        {
            IEnumerable <Theatre>  theatre        = theatreBl.DisplayTheatre();
            List <SignUpNextModel> displayTheatre = new List <SignUpNextModel>();

            foreach (var result in theatre)
            {
                SignUpNextModel signUpNextModel = AutoMapper.Mapper.Map <Theatre, SignUpNextModel>(result);  //using Auto mapper
                displayTheatre.Add(signUpNextModel);
            }
            return(View(displayTheatre));
        }
        public ActionResult DisplayMovie()
        {
            IEnumerable <Movie>    movie          = movieBl.DisplayMovie();
            MultipleModel          displayMovie   = new MultipleModel();
            List <MovieModel>      model          = new List <MovieModel>();
            List <SignUpNextModel> displayTheatre = new List <SignUpNextModel>();

            foreach (var result in movie)
            {
                MovieModel movieModel = AutoMapper.Mapper.Map <Movie, MovieModel>(result);  //using auto mapper
                model.Add(movieModel);
                Theatre         theatre      = theatreBl.DisplayTheatre(result.TheatreId);
                SignUpNextModel theatreModel = AutoMapper.Mapper.Map <Theatre, SignUpNextModel>(theatre);
                displayTheatre.Add(theatreModel);
            }
            displayMovie.Movies   = model;
            displayMovie.Theatres = displayTheatre;
            return(View(displayMovie));
        }