public string SetVote(string identityNo, int electionId, int RegionId, string District, string timeStampt, string hashingData) { if (Hash(pass + timeStampt) == hashingData) { try { m_internetDc = new VoteDataContext(Globals.ConnectionString); var vote = new VoteDetail(); if (m_internetDc.Districts.Any(x => x.DistrictName == District)) { vote.DistrictId = m_internetDc.Districts.First(x => x.DistrictName == District).DistrictId; vote.ElectionId = electionId; vote.IdentityNo = identityNo; vote.RegionId = RegionId; vote.VotingDate = DateTime.Now; m_internetDc.VoteDetails.InsertOnSubmit(vote); m_internetDc.SubmitChanges(); return("Succeeded"); } else { return("Error:Voter informationsnot correct!"); } } catch (Exception ex) { return("Error"); } } return("Not Authorized!"); }
partial void DeleteVoteDetail(VoteDetail instance);
public string SetVote(string identityNo, int electionId, int RegionId, string District, string timeStampt, string hashingData) { if (Hash(pass + timeStampt) == hashingData) { try { m_internetDc = new VoteDataContext(Globals.ConnectionString); var vote = new VoteDetail(); if (m_internetDc.Districts.Any(x => x.DistrictName == District)) { vote.DistrictId = m_internetDc.Districts.First(x => x.DistrictName == District).DistrictId; vote.ElectionId = electionId; vote.IdentityNo = identityNo; vote.RegionId = RegionId; vote.VotingDate = DateTime.Now; m_internetDc.VoteDetails.InsertOnSubmit(vote); m_internetDc.SubmitChanges(); return "Succeeded"; } else return "Error:Voter informationsnot correct!"; } catch (Exception ex) { return "Error"; } } return "Not Authorized!"; }
partial void UpdateVoteDetail(VoteDetail instance);
partial void InsertVoteDetail(VoteDetail instance);