Ejemplo n.º 1
0
        public ActionResult <string> AddShow(ApiShow apiShow)
        {
            string returnString = "Add Show failed: ";

            Show show = new Show {
                MovieId   = apiShow.Movie,
                HallId    = apiShow.Hall,
                Data      = apiShow.Date,
                StartTime = apiShow.Time,
                EndTime   = apiShow.Time.AddHours(4)
            };

            bool?success = _sqlService.AddShow(show);

            if (success == null)
            {
                return(returnString + "Time mabye overlab O.o");
            }
            else if (success == false)
            {
                return(returnString + "Failed to add seats to show, but shows is added...");
            }
            else
            {
                return("Add movie success");
            }
        }