コード例 #1
0
ファイル: Poll.cs プロジェクト: okyereadugyamfi/softlogik
        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
ファイル: Poll.cs プロジェクト: okyereadugyamfi/softlogik
        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;
        }