Пример #1
0
        public virtual bool HasVoted(int pollId, int hungryProfessionalId, out Vote vote)
        {
            vote = (from v in LPContext.Vote.Include("SelectedRestaurant")
                    where v.PollId == pollId &&
                    v.HungryProfessionalId == hungryProfessionalId
                    select v).FirstOrDefault();

            return (vote != null);
        }
Пример #2
0
        public virtual void RegisterVote(int pollId, int professionalId, int selectedRestaurantId)
        {
            var vote = new Vote
            {
                PollId = pollId,
                HungryProfessionalId = professionalId,
                SelectedRestaurantId = selectedRestaurantId
            };

            DAL.SaveVote(vote);
        }
Пример #3
0
 public virtual bool HasVoted(int pollId, int  hungryProfessionalId, out Vote vote)
 {
     return DAL.HasVoted(pollId, hungryProfessionalId, out vote);
 }
Пример #4
0
        public virtual void SaveVote(Vote vote)
        {
            LPContext.Vote.Add(vote);

            LPContext.SaveChanges();
        }