Esempio n. 1
0
        public override OperacijaRezultat izvrsi(ArchitectDatabaseEntities entiteti)
        {
            int num = (from votes in entiteti.PollVotes
                       join answer in entiteti.PollAnswers on votes.idAnswer equals answer.idPollAnswer
                       where Vote.IpAddress == votes.ipAddress && Vote.IdQuestion == answer.idPollQuestion
                       select votes).Count();
            OperacijaRezultat result = new OperacijaRezultat()
            {
                Poruka = "inserting poll vote"
            };

            if (num == 0)
            {
                entiteti.spInsertPollVote(Vote.IpAddress, Vote.IdAnswer);
                result.Status = true;
            }
            else
            {
                result.Status = false;
            }

            return(result);
        }