public void AddShowing()
        {
            var showingDto = new ShowingDto()
            {
                MovieId         = 20,
                MovieTitle      = "Lewiatan",
                TheatreId       = 1,
                ShowingDateTime = new DateTime(2019, 8, 15, 20, 30, 0)
            };

            addedShowingId = _services.InsertOrUpdate(showingDto);
            var showingDb = _services.Get(addedShowingId);

            Assert.ReferenceEquals(showingDb, showingDto);
        }
Example #2
0
        /// <summary>
        /// Adds or updates the showing.
        /// </summary>
        /// <param name="show"></param>
        /// <returns>Returns true if command succeed.</returns>
        public bool Post(Showing show)
        {
            var id = _showingService.InsertOrUpdate(new ShowingDto()
            {
                Id              = show.Id,
                MovieId         = show.MovieId,
                MovieTitle      = show.MovieTitle,
                TheatreId       = show.TheatreId,
                ShowingDateTime = show.ShowingDateTime
            });

            if (id > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            };
        }
Example #3
0
 public IHttpActionResult Post([FromBody] ShowingDto showing)
 {
     _showingService.InsertOrUpdate(showing);
     return(Json(true));
 }