public async Task FinalizeCandidatesAsync(int electionId, DateTime dateTime) { await Task.CompletedTask; using (var tableAdapter = new ElectionTableAdapter()) { tableAdapter.FinalizeCandidatesQuery(dateTime, electionId); } }
public async Task CloseElectionAsync(int electionId, DateTime dateTime) { await Task.CompletedTask; using (var tableAdapter = new ElectionTableAdapter()) { tableAdapter.CloseElectionQuery(dateTime, electionId); } }
public async Task UpdateServerTagAsync(int electionId, string serverTag) { await Task.CompletedTask; using (var tableAdapter = new ElectionTableAdapter()) { tableAdapter.UpdateServerTagQuery(serverTag, electionId); } }
public async Task UpdateElectionAsync(ElectionModel election) { await Task.CompletedTask; using (var tableAdapter = new ElectionTableAdapter()) { tableAdapter.Update( election.Title, election.Description, election.TookPlaceOn, election.CandidatesFinalizedAt, election.ClosedAt, election.ServerTag, election.Id ); } }
public async Task <ElectionModel> GetElectionByServerTagAsync(string tag) { await Task.CompletedTask; using (var tableAdapter = new ElectionTableAdapter()) { var row = tableAdapter.GetElectionsByServerTag(tag).SingleOrDefault(); if (row == null) { return(null); } var model = new ElectionModel(); _mapper.Map(row, model); return(model); } }
public async Task <ElectionModel> GetCurrentElectionAsync() { await Task.CompletedTask; using (var tableAdapter = new ElectionTableAdapter()) { var row = tableAdapter.GetCurrentElections().SingleOrDefault(); if (row == null) { return(null); } var model = new ElectionModel(); _mapper.Map(row, model); return(model); } }