Пример #1
0
        public static PollQuestion GetLatestQuestion()
        {
            Query qry = new Query(ACSGhana.Web.Framework.Data.Tables.PollQuestions);
            qry.Top = "1";
            qry.OrderBy = OrderBy.Desc(PollQuestions.Columns.CreationDate);
            qry.SelectList = PollQuestions.Columns.PollId + "," + PollQuestions.Columns.Question + "," + PollQuestions.Columns.CreationDate;

            IDataReader rdr = qry.ExecuteReader();
            PollQuestion q = new PollQuestion();
            while (rdr.Read())
            {
                q.PollId = rdr.GetGuid(0);
                q.Question = rdr.GetString(1);
                q.CreationDate = rdr.GetDateTime(2);
            }
            rdr.Close();
            return q;
        }
Пример #2
0
        public static PollQuestion LoadQuestion(Guid pollId)
        {
            if (pollId == Guid.Empty)
            {
                return null;
            }

            PollQuestions quest = new PollQuestions(PollQuestions.Columns.PollId, pollId);
            PollQuestion q = new PollQuestion();
            q.PollId = pollId;
            q.Question = quest.Question;
            q.CreationDate = quest.CreationDate;
            return q;
        }