public IPlanshetViewData InitialPlanshetConfederation(IDbConnection connection, IGameUserService gu) { _checkAndRunVoteState(connection, 0, false); var officerOut = GetOfficers(connection, true); TabOfficer tabOficers = null; TabElection tabElection = null; if (officerOut != null) { tabOficers = new TabOfficer(officerOut); tabElection = GetTabElection(connection, true); } else { // нет инициализации нет голосования нет офицеров tabOficers = new TabOfficer(); tabElection = new TabElection(false, new List <CandidatOut>(), 0); tabElection.SetTimes(StartRegistrationTime, StartVoteTime, EndVoteTime); } var users = gu.GetTopPvpUsers(connection, 0, TabUserRating.PER_PAGE); var rating = new TabUserRating(users, 0); return(ConfederationPlanshetOut.InitialTabs(tabOficers, rating, tabElection, _svp.GetService <ILocalizerService>())); }
public TabElection GetTabElection(IDbConnection connection, bool periodIsCheked = false) { var votingInProgress = VotingInProgress; //var voting = new TabElection(!votingInProgress, await _getFakeCandidates(periodIsCheked), votingInProgress ? 0 : REGISTER_CANDIDATE_CC_PRICE); var voting = new TabElection(!votingInProgress, GetCandidates(connection, periodIsCheked), votingInProgress ? 0 : REGISTER_CANDIDATE_CC_PRICE); voting.SetTimes(StartRegistrationTime, StartVoteTime, EndVoteTime); return(voting); }