예제 #1
0
        public void Configuration(IAppBuilder app)
        {
            ///Configure Hangfire to use SQL Server
            GlobalConfiguration.Configuration.UseSqlServerStorage(ConfigurationManager.ConnectionStrings["BetaWatchModel"].ConnectionString);

            ///Route the Hangfire Dashboard to /JobDashboard        TODO: ADD PROTECTION
            app.UseHangfireDashboard("/JobDashboard");

            ///Start a server to handle requests
            _jobServer = new BackgroundJobServer();

            ///Start a job to update the database hourly
            RecurringJob.AddOrUpdate("RefreshDatabase", () => CrackwatchFunctions.RefreshDatabase(), Cron.Hourly);

            RecurringJob.Trigger("RefreshDatabase");
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Fetch a list of 50 unreleased games from crackwatch and deserialize them
            GamesList = CrackwatchFunctions.Fetch_Games(0);

            foreach (var game in GamesList)
            {
                TableRow gameRow = new TableRow();

                TableCell gameName    = new TableCell();
                TableCell releaseDate = new TableCell();

                gameName.Text    = game.title;
                releaseDate.Text = game.releaseDate.ToString("yyyy-MM-dd");

                gameRow.Cells.Add(gameName);

                gameRow.Cells.Add(releaseDate);


                GamesTable.Rows.Add(gameRow);
            }
        }