コード例 #1
0
        public void LoadAnswerForQuestions(int questionid)
        {
            StudioMAnswer.Clear();
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StudioM_GetAnswerForQuestion(questionid);

            client.Close();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                StudioMResource.Answer a = new StudioMResource.Answer();
                a.AnswerID   = int.Parse(dr["idtemplateanswer"].ToString());
                a.AnswerText = dr["answer"].ToString();

                bool exists = false;
                foreach (StudioMResource.Answer prod in SelectedAnswer)
                {
                    if (a.AnswerID == prod.AnswerID)
                    {
                        exists = true;
                        break;
                    }
                }
                if (!exists)
                {
                    StudioMAnswer.Add(a);
                }
            }
        }
コード例 #2
0
        public void LoadAnswerForQuestions(int questionid)
        {
            StudioMAnswer.Clear();
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StudioM_GetAnswerForQuestion(questionid);

            client.Close();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                StudioMResource.Answer b = new StudioMResource.Answer();
                b.AnswerID   = int.Parse(dr["idtemplateanswer"].ToString());
                b.AnswerText = dr["answer"].ToString();
                StudioMAnswer.Add(b);
            }
        }