public int CreateGame(GameBLL game)
        {
            int ProposedReturnValue = -1;

            ProposedReturnValue = _context.CreateGame(game.GameName);
            return(ProposedReturnValue);
        }
        public GameBLL FindGameByGameID(int GameID)
        {
            GameBLL ProposedReturnValue = null;
            GameDAL DataLayerObject     = _context.FindGameByGameID(GameID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new GameBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
        public List <GameBLL> GetGames(int skip, int take)
        {
            List <GameBLL> ProposedReturnValue    = new List <GameBLL>();
            List <GameDAL> ListOfDataLayerObjects = _context.GetGames(skip, take);

            foreach (GameDAL Game in ListOfDataLayerObjects)
            {
                GameBLL BusinessObject = new GameBLL(Game);
                ProposedReturnValue.Add(BusinessObject);
            }
            return(ProposedReturnValue);
        }
Ejemplo n.º 4
0
 public ActionResult Edit(int id, BusinessLogicLayer.GameBLL collection)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(View(collection));
         }// TODO: Add update logic here
         using (ContextBLL ctx = new ContextBLL())
         {
             ctx.UpdateGame(collection);
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ViewBag.exception = ex;
         return(View("Error"));
     }
 }
 public void DeleteGame(GameBLL game)
 {
     _context.DeleteGame(game.GameID);
 }
 public void UpdateGame(GameBLL game)
 {
     _context.UpdateGame(game.GameID, game.GameName);
 }