public void UpdateAnswerVotesCount(int aid, int uid, int value)
        {
            Answer existingA = db.Answers.Where(t => t.AnswerID == aid).FirstOrDefault();

            if (existingA != null)
            {
                existingA.VotesCount += value;
                db.SaveChanges();
                qr.UpdateQuestionVotesCount(existingA.QuestionID, value);
                vr.UpdateVote(aid, uid, value);
            }
        }
        public void UpdateAnswerVotesCount(int aid, int uid, int value)
        {
            Answer ans = db.Answers.Where(temp => temp.AnswerID == aid).FirstOrDefault();

            if (ans != null)
            {
                ans.VotesCount += value;
                db.SaveChanges();
                qr.UpdateQuestionVotesCount(ans.QuestionID, value);
                vr.UpdateVote(aid, uid, value);
            }
        }
        public void UpdateAnswerVotesCount(int answerId, int userId, int value)
        {
            Answer updateanswer = knowledgesharingDB.Answers.Where(temp => temp.AnswerID == answerId).FirstOrDefault();

            if (updateanswer != null)
            {
                updateanswer.VotesCount += value;
                knowledgesharingDB.SaveChanges();
                questionRepository.UpdateQuestionVotesCount(updateanswer.QuestionID, value);
                votesRepository.UpdateVote(answerId, userId, value);
            }
        }
Пример #4
0
        public void UpdateAnswerVotesCount(int AnswerID, int UserID, int Value)
        {
            Answer ans = db.Answers.Where(temp => temp.AnswerID == AnswerID).FirstOrDefault();

            if (ans != null)
            {
                ans.VotesCount += Value;
                db.SaveChanges();
                qr.UpdateQuestionVotesCount(ans.QuestionID, Value);
                vr.UpdateVote(AnswerID, UserID, Value);
            }
        }
Пример #5
0
 public void UpdateVote(Vote Vote)
 {
     _voteRepository.UpdateVote(Vote);
 }