public async Task <IActionResult> PostNewVote([FromBody] VoteRawModel voteModelRaw) { if (ModelState.IsValid) { if (voteModelRaw != null) { try { await _sendToEventHubService.SendMessageToEventHub(EhEntityPathVoteRaw, voteModelRaw); //TODO Insertar y recuperar valores var votingResults = new VotingResultsModel { PositiveVote = new Random().Next(10, 20), NegativeVote = new Random().Next(1, 9) }; await _sendToEventHubService.SendMessageToEventHub(EhEntityPathVotingResults, votingResults); return(Ok()); } catch (Exception ex) { //Log.Info($"Internal Server Error - {ex.Message}"); return(StatusCode(500)); } } return(BadRequest()); } return(BadRequest()); }
public ActionResult FilterSectionVotingDetails(VotingResultsModel model) { TryUpdateModel(model); VotingService service = new VotingService(); model = service.GetResultsForLawSection(model); model.ActionName = "FilterSectionVotingDetails"; return(PartialView("_VotingDetails", model)); }
public OrganizationViewModel() { Members = new List <MemberModel>(); UnconfirmedMembers = new List <UserLinkModel>(); InvitedUsers = new List <InviteUserModel>(); UsersToInvite = new List <InviteUserModel>(); Ideas = new IdeaIndexModel(); Issues = new VotingIndexModel(); Results = new VotingResultsModel(); Problems = new ProblemIndexModel(); }
public ActionResult GetSectionVotingDetails(int id) { VotingService service = new VotingService(); VotingResultsModel model = service.GetResultsForLawSection(new VotingResultsModel { ID = id }); model.ActionName = "FilterSectionVotingDetails"; return(PartialView("_VotingDetails", model)); }
public Models.VotingResultsModel PrepareFilters() { using (var context = JavnaRasprava.WEB.DomainModels.ApplicationDbContext.Create()) { var result = new VotingResultsModel { Parties = UserService.GetAllPartiesSelectListInternal(context), Locations = UserService.GetAllLocationsSelectListInternal(context) }; return(result); } }