private void Stats_clicked(object sender, RoutedEventArgs e) { DataContext = new DBStats(conn); Badd.IsEnabled = true; Bsearch.IsEnabled = true; Bstats.IsEnabled = false; }
private void UpdatePlayerAchievementsDB() { foreach (KeyValuePair <Server_ServerClient, PlayerScore> player in playerToScore) { bool won = player.Value.guid == scores[scores.Count - 1].guid; if (won) { DBStats.IncrementWins(player.Key.DBPlayerId, player.Key.kills, player.Key.deaths); } else { DBStats.IncrementLoss(player.Key.DBPlayerId, player.Key.kills, player.Key.deaths); } } }
/// <summary> /// </summary> /// <returns> /// </returns> public bool ReadNames() { bool success = false; DBCharacter character = CharacterDao.Instance.Get((int)this.CharacterId); if (character != null) { this.characterName = character.Name; this.characterFirstName = character.FirstName; this.characterLastName = character.LastName; DBStats clan = StatDao.Instance.GetById(50000, (int)this.CharacterId, 5); if (clan != null) { DBOrganization org = OrganizationDao.Instance.Get(clan.StatValue); this.orgName = org.Name; } success = true; } return(success); }
/// <summary> /// </summary> /// <returns> /// </returns> public bool ReadNames() { List <DBCharacter> chars = new List <DBCharacter>(CharacterDao.GetById((int)this.CharacterId)); if (chars.Count > 0) { this.characterName = chars[0].Name; this.characterFirstName = chars[0].FirstName; this.characterLastName = chars[0].LastName; DBStats clan = StatDao.GetById(50000, (int)this.CharacterId, 5); if (clan != null) { DBOrganization org = OrganizationDao.GetOrganizationData(clan.statvalue); this.orgName = org.Name; } } else { return(false); } return(true); }