Exemple #1
0
        public static propQuestion GetById(int id)
        {
            var data     = DataAccess.Question.Get(id);
            var question = new propQuestion();

            while (data.Read())
            {
                question.id        = int.Parse(data["Id"].ToString());
                question.question  = data["Question"].ToString();
                question.projectId = int.Parse(data["ProjectId"].ToString());
            }
            data.Close();
            return(question);
        }
Exemple #2
0
        public static List <propQuestion> Get(int projectId)
        {
            var listQuestion = new List <propQuestion>();
            var data         = DataAccess.Question.GetByProject(projectId);

            while (data.Read())
            {
                propQuestion question = new propQuestion();
                question.id        = int.Parse(data["Id"].ToString());
                question.question  = data["Question"].ToString();
                question.projectId = int.Parse(data["ProjectId"].ToString());
                listQuestion.Add(question);
            }
            data.Close();
            return(listQuestion);
        }