public ContestVote AddContestVote(ContestVote contestVote) { contestVote.VotedDate = contestVote.UpdatedDate = date; contestVote.Status = "Active"; contestVote = _dbContext.ContestVote.Add(contestVote); _dbContext.SaveChanges(); return(contestVote); }
public int RemoveContestVote(ContestVote contestVote) { var record = _dbContext.ContestVote.SingleOrDefault(i => i.ContestVoteID == contestVote.ContestVoteID); contestVote.UpdatedDate = date; contestVote.Status = "InActive"; _dbContext.Entry(record).CurrentValues.SetValues(contestVote); int count = _dbContext.SaveChanges(); return(count); }
public static async Task <ContestVoteResults> SaveContestVote(ContestVote vote) { APIService srv = new APIService(); ContestVoteModel model = new ContestVoteModel(); Dictionary <string, string> p = new Dictionary <string, string>(); p.Add("obj", JsonConvert.SerializeObject(vote)); model.CommandModel.SessionToken = await App.GetUsersSession(); model.CommandModel.ServiceName = "ContestVote"; model.CommandModel.Action = "Save"; model.CommandModel.Parameters = p; return(await srv.SaveContestVote(model.CommandModel)); }
public int RemoveContestVote(ContestVote contestVote) { return(contestsRepoitory.RemoveContestVote(contestVote)); }
public ContestVote AddContestVote(ContestVote contestVote) { return(contestsRepoitory.AddContestVote(contestVote)); }