public ActionResult Edit(int id) { if (Session["EmailId"] == null) { return(RedirectToAction("Index", "Home")); } VoterRepository repo = new VoterRepository(); var busEntity = voterRepository.FindVoter(id); Models.Voter voter = new Models.Voter() { VoterId = busEntity.VoterId, VoterName = busEntity.VoterName, Age = busEntity.Age, DOB = busEntity.DOB, Gender = busEntity.Gender, City = busEntity.City, State = busEntity.State, EmailId = busEntity.EmailId, MobileNumber = busEntity.MobileNumber }; return(View(voter)); }
public ActionResult Delete(int id) { VoterRepository repo = new VoterRepository(); var bEntity = repo.FindVoter(id); Models.Voter voter = new Models.Voter() { VoterId = bEntity.VoterId, VoterName = bEntity.VoterName, Age = bEntity.Age, DOB = bEntity.DOB, Gender = bEntity.Gender, City = bEntity.City, State = bEntity.State, EmailId = bEntity.EmailId, MobileNumber = bEntity.MobileNumber }; return(View(voter)); }