public JsonResult GetLocationInfo() { if (UserSession.CurrentLocation == null) { return(new { Message = "Must select your location first!" }.AsJsonResult()); } var locationModel = ContextItems.LocationModel; // if (UserSession.CurrentElection.IsSingleNameElection) // { // return new // { // Location = locationModel.CurrentBallotLocationInfo(), // BallotInfo = CurrentBallotModel.CurrentBallotInfo(), // Ballots = CurrentBallotModel.CurrentBallotsInfoList() // }.AsJsonResult(); // } return(new { Location = locationModel.CurrentBallotLocationInfo(), BallotInfo = CurrentBallotModel.CurrentBallotInfo(), Ballots = CurrentBallotModel.CurrentBallotsInfoList() }.AsJsonResult()); }
public JsonResult SortVotes(List <int> idList) { if (UserSession.CurrentElectionStatus == ElectionTallyStatusEnum.Finalized) { return(new { Message = UserSession.FinalizedNoChangesMessage }.AsJsonResult()); } return(CurrentBallotModel.SortVotes(idList, new VoteCacher(Db)).AsJsonResult()); }
public JsonResult SwitchToBallot(int ballotId, bool refresh) { return(CurrentBallotModel.SwitchToBallotAndGetInfo(ballotId, refresh).AsJsonResult()); }
public JsonResult NeedsReview(bool needs) { return(CurrentBallotModel.SetNeedsReview(needs)); }
public JsonResult DeleteVote(int vid) { return(CurrentBallotModel.DeleteVote(vid)); }
public JsonResult SaveVote(int pid, int vid, string invalid = "", int count = 0, int lastVid = 0, bool verifying = false) { var invalidGuid = invalid.AsNullableGuid(); return(CurrentBallotModel.SaveVote(pid, vid, invalidGuid, lastVid, count, verifying)); }
public JsonResult DeleteBallot() { return(CurrentBallotModel.DeleteBallotJson()); }
public JsonResult NewBallot() { return(CurrentBallotModel.StartNewBallotJson()); }
public JsonResult ChangeBallotFilter(string code) { UserSession.CurrentBallotFilter = code; return(CurrentBallotModel.CurrentBallotsInfoList().AsJsonResult()); }
public JsonResult RefreshBallotsList() { return(CurrentBallotModel.CurrentBallotsInfoList(true).AsJsonResult()); }