Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
 public JsonResult SwitchToBallot(int ballotId, bool refresh)
 {
     return(CurrentBallotModel.SwitchToBallotAndGetInfo(ballotId, refresh).AsJsonResult());
 }
Esempio n. 4
0
 public JsonResult NeedsReview(bool needs)
 {
     return(CurrentBallotModel.SetNeedsReview(needs));
 }
Esempio n. 5
0
 public JsonResult DeleteVote(int vid)
 {
     return(CurrentBallotModel.DeleteVote(vid));
 }
Esempio n. 6
0
        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));
        }
Esempio n. 7
0
 public JsonResult DeleteBallot()
 {
     return(CurrentBallotModel.DeleteBallotJson());
 }
Esempio n. 8
0
 public JsonResult NewBallot()
 {
     return(CurrentBallotModel.StartNewBallotJson());
 }
Esempio n. 9
0
 public JsonResult ChangeBallotFilter(string code)
 {
     UserSession.CurrentBallotFilter = code;
     return(CurrentBallotModel.CurrentBallotsInfoList().AsJsonResult());
 }
Esempio n. 10
0
 public JsonResult RefreshBallotsList()
 {
     return(CurrentBallotModel.CurrentBallotsInfoList(true).AsJsonResult());
 }