Esempio n. 1
0
 public ActionResult ForgiveBidsByCandidate(int candidateId = 0)
 {
     try
     {
         CandidateRepository cr = new CandidateRepository();
         bidRepository       br = new bidRepository();
         if (candidateId == 0)
         {
             IEnumerable <int> candidateList = cr.GetAllCandidates();
             foreach (int cId in candidateList)
             {
                 br.UpdateVoteStatusByCandidateId(cId, 2);
             }
         }
         else
         {
             br.UpdateVoteStatusByCandidateId(candidateId, -1);
         }
         return(Json(new { success = true }));
     }
     catch (Exception e)
     {
         return(Json(new { success = false, message = e.Message }));
     }
 }