public ActionResult Rate(int id)
        {
            ContestantRatingDTO contestantRating = new ContestantRatingDTO();

            contestantRating.ContestantId = id;
            contestantRating.FullName     = unitOfWork.Contestant.Get(id).FirstName + " " + unitOfWork.Contestant.Get(id).LastName;
            contestantRating.PhotoUrl     = unitOfWork.Contestant.Get(id).PhotoUrl;
            int districtId = unitOfWork.Contestant.Get(id).DistrictId;

            contestantRating.District = unitOfWork.District.Get(districtId).Name;
            return(PartialView("_Rate", contestantRating));
        }
 public ActionResult AddRating(ContestantRatingDTO contestantRating)
 {
     try
     {
         ContestantRating rating = Mapper.Map <ContestantRating>(contestantRating);
         rating.RatedDate = DateTime.Now;
         unitOfWork.ContestantRating.Add(rating);
         unitOfWork.Complete();
     }
     catch (Exception e)
     {
         TempData["Message"]     = "Rating failed !";
         TempData["MessageType"] = "danger";
         return(RedirectToAction("Index"));
     }
     TempData["Message"]     = "Rating successfull !";
     TempData["MessageType"] = "success";
     return(RedirectToAction("Index"));
 }