示例#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));
        }
示例#2
0
 public GameGateway GetGameGateway()
 {
     return gameGW != null ? gameGW : gameGW = new GameGateway();
 }
示例#3
0
 public static Collection <GameModel> GetAllResults()
 {
     db = new Database();
     return(GameGateway.LoadAll(db));
 }
示例#4
0
 public GameService() : base(new GameGateway(), new GameValidator())
 {
     _gateway = new GameGateway();
 }