예제 #1
0
        public ActionResult CreateProjection([Bind(Include = "ProjectionId,DateProjection,SalleId,FilmId")] Projection projection)
        {
            if (ModelState.IsValid)
            {
                projectionSevice.Add(projection);
                projectionSevice.Commit();
                return(RedirectToAction("Index"));
            }

            ViewBag.FilmId  = new SelectList(filmService.GetMany(), "FilmId", "FilmTitle", projection.FilmId);
            ViewBag.SalleId = new SelectList(salleSevice.GetMany(), "SalleId", "NomSalle", projection.SalleId);
            return(View("Projection/Create", projection));
        }
 public IEnumerable <ProjectionDTO> Post(int theaterId, [FromBody] IEnumerable <ProjectionBindingModel> projections)
 {
     return(_projectionService.Add(theaterId, projections.Select <ProjectionBindingModel, Projection>(x => x)));
 }