Esempio n. 1
0
        public static int CreateGame(string name, int pegi, string description
                                     , double pricen, double priceo, double pricep, string img, string availability)
        {
            db = new Database();
            GameModel data = new GameModel
            {
                Name          = name,
                Pegi          = pegi,
                Description   = description,
                PriceNew      = pricen,
                PriceOld      = priceo,
                PricePurchase = pricep,
                CoverImage    = img,
                Availability  = availability,
            };
            LogUnit log;

            log.id      = 1;
            log.message = DateTime.Now.Date.ToString() + " new game added: " + data.Name;
            LogGateway.LoadDocument(@"C:\vis\WebApplication\DataLibrary\test.xml");
            LogGateway.Insert(ref log);
            return(GameGateway.Insert(db, data));
        }
Esempio n. 2
0
 public GameGateway GetGameGateway()
 {
     return gameGW != null ? gameGW : gameGW = new GameGateway();
 }
Esempio n. 3
0
 public static Collection <GameModel> GetAllResults()
 {
     db = new Database();
     return(GameGateway.LoadAll(db));
 }
Esempio n. 4
0
 public GameService() : base(new GameGateway(), new GameValidator())
 {
     _gateway = new GameGateway();
 }