private void InitializeVariables() { _clientService = ClientService.Instance; _movieService = MovieService.Instance; _videoGameService = VideoGameService.Instance; _rentalService = RentalService.Instance; }
public IHttpActionResult GetVideoGamesByConsoleType(string consoleType) { VideoGameService service = new VideoGameService(); var games = service.GetVideoGamesByConsoleType(consoleType); return(Ok(games)); }
public IHttpActionResult Get(int id) { VideoGameService videoGameService = CreateVideoGameService(); var videoGame = videoGameService.GetVideoGameById(id); return(Ok(videoGame)); }
public IHttpActionResult Get() { VideoGameService videoGameService = CreateVideoGameService(); var videoGames = videoGameService.GetVideoGames(); return(Ok(videoGames)); }
public ActionResult AddOrUpdate(NewVideoGameViewModel vm) { VideoGameService.AddNewGameOrUpdate(new VideoGame { Description = vm.Description, Name = vm.VideoGameName, PlatformId = vm.SelectedPlatformId, RatingId = vm.SelectedRatingId, ReleasedDate = (vm.ReleasedDate ?? DateTime.Now), Rented = vm.Rented, UPC = vm.UPC }); return(RedirectToAction("Index", "Home")); }
private void InitializeVariables() { _todayDateTime = DateTime.Today; _videoGameService = VideoGameService.Instance; _itemsStateProduct = new Dictionary <StateProductEnum, string> { { StateProductEnum.All, _resourceManager.GetResourceValue("ALL_VIDEOGAMES") } }; _itemsStateProduct.Append(GetAllStateProductEnum()); _changeItemsStateProduct = GetAllStateProductEnum(); FillSourcePlatformComboBox(); }
public JsonResult Search(string searchString) { var vms = new List <VideoGameViewModel>(); var foundGames = VideoGameService.GetVideoGameByName(searchString); foreach (var game in foundGames) { var vm = new VideoGameViewModel(game); vm.PlatformName = PlatformService.Get(game.PlatformId).Name; vm.RatingName = RatingService.Get(game.RatingId).Name; vms.Add(vm); } return(Json(vms, JsonRequestBehavior.AllowGet)); }
public void DeleteVideoGames(List <int> ids) { VideoGameService.DeleteVideoGames(ids); }
public void ChangeStatusOfRentals(List <VideoGame> games) { VideoGameService.SaveRentalBroughtBacks(games); }
private VideoGameService CreateVideoGameService() { var VideoGameService = new VideoGameService(); return(VideoGameService); }