예제 #1
0
        public void LoadQuestions(int pstateid)
        {
            StudioMQuestion.Clear();
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StudioM_GetActiveQuestions(pstateid);

            client.Close();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                StudioMResource.Question b = new StudioMResource.Question();
                b.QuestionID      = int.Parse(dr["idtemplatequestion"].ToString());
                b.QuestionText    = dr["question"].ToString();
                b.AnswerTypeID    = int.Parse(dr["fkidanswertype"].ToString());
                b.AnswerType      = dr["answertype"].ToString();
                b.QuestionAndType = dr["questionandtype"].ToString();
                b.Mandatory       = bool.Parse(dr["mandatory"].ToString());
                StudioMQuestion.Add(b);
            }
        }