void HandleDatabaseScenario(UserScenarioState loadedScenario, QuickUser user) { if (string.IsNullOrEmpty(loadedScenario.currentScenario)) { return; } // If the scenario state from the database is too old, reset it and stop. DateTime parsedDate = JavascriptDateUtility.ToDateTime(loadedScenario.startDate); if ((DateTime.Now - parsedDate).TotalMinutes > 1) { ResetDatabaseScenario(); return; } loadedScenario.user = user; DatabaseScenario.Value = loadedScenario; return; }
public UserScenarioState(string inCurrentScenario, QuickUser inUser) { currentScenario = inCurrentScenario; startDate = JavascriptDateUtility.ToJavascript(DateTime.Now); user = inUser; }