Esempio n. 1
0
        public ActionResult PostSchedule([FromBody] TimeTableFilms obj)
        {
            if (obj == null)
            {
                return(BadRequest());
            }
            _db.SetValue(obj.GetType().Name, obj);

            TimeTableFilms timeTable = _db.GetTimeTableFilm(obj).Result;

            return(CreatedAtAction("GetFilmSchedule", new { timeTable.id }, timeTable));
        }
Esempio n. 2
0
        public ActionResult PutSchedule([FromBody] TimeTableFilms obj)
        {
            if (obj == null)
            {
                return(BadRequest());
            }
            TimeTableFilms timeTable = _db.GetTimeTableFilm(obj.id).Result;

            if (timeTable == null)
            {
                return(NotFound());
            }
            timeTable.idFilm   = obj.idFilm;
            timeTable.dateTime = obj.dateTime;

            _db.Save(timeTable.GetType().Name, timeTable.id, timeTable);

            return(Ok(timeTable));
        }