void UpdateLeaderboard(ref EntryCard[] board, LeaderboardEntry_t[] entries, RectTransform boardUI) { if (entries == null) { return; // entries not recieved yet } ClearBoard(ref board); board = new EntryCard[entries.Length]; for (int i = 0; i < entries.Length; i++) { GameObject newEntry = Instantiate(entryPrefab, boardUI); newEntry.SetActive(true); newEntry.name = i.ToString(); board[i] = new EntryCard(newEntry, entries[i].m_nGlobalRank, entries[i].m_steamIDUser, SteamFriends.GetFriendPersonaName(entries[i].m_steamIDUser), entries[i].m_nScore, scoreFormat); } }
public string ActiveEntryCard(int profileId, int loginId, int cardId = 0, bool active = false, string card = "") { ResponseModel resp = new ResponseModel(); var user = _userservices.GetUserProfiles(userManager.GetUserId(User).ToString(), 0, 0); if (profileId > 0 && loginId > 0 && cardId != 0) { EntryCard Card = new EntryCard { EntryCardId = cardId, Card = card, Active = active, ProfileId = profileId, LoginId = loginId, EditLogiId = user.LoginId, EditProfileId = user.ProfileId }; resp = _userservices.UpdateEntryCard(Card); } if (resp.response) { resp.message = "ok|Tarjeta (" + resp.identity.ToString() + ") Actualizada| "; if (active) { resp.message += "ACTIVACION DE TARJETA"; } else { resp.message += "DE-ACTIVACION DE TARJETA"; } } else { if (!string.IsNullOrEmpty(resp.message)) { resp.message = "wn|Tarjeta (" + resp.identity.ToString() + ") NO Actualizada, revise información | ACTIVACION DE TARJETA"; } } return(resp.message); }
public string AddEntryCard(string userId, int loginId, int profileId, string card) { ResponseModel resp = new ResponseModel(); var user = _userservices.GetUserProfiles(userManager.GetUserId(User).ToString(), 0, 0); if (profileId > 0 && loginId > 0 && !string.IsNullOrEmpty(card) && card.Length == 10) { EntryCard Card = new EntryCard { Card = card, ProfileId = profileId, LoginId = loginId, UserId = userId, CreateProfileId = user.ProfileId, EditProfileId = user.ProfileId, CreateLogiId = user.LoginId, EditLogiId = user.LoginId }; resp = _userservices.AddEntryCard(Card); } else if (card.Length != 10) { resp.message = "wn|Tarjeta NO Adicionada, número de digitos <> 10|ADICION DE TARJETA"; resp.response = false; } if (resp.response) { resp.message = "ok|Tarjeta Adicionada (" + resp.identity.ToString() + ")|ADICION DE TARJETA"; } else { if (!string.IsNullOrEmpty(resp.message)) { resp.message = "wn|Tarjeta NO Adicionada, revise información|ADICION DE TARJETA"; } } return(resp.message); }