Ejemplo n.º 1
0
        public void SetQuestionsInPanel()
        {
            panelQuestions.Controls.Clear();

            string responseString = QuestionHelper.GetQuestion();
            var    questions      = JsonConvert.DeserializeObject <List <Model.QuestionModel> >(responseString);
            var    rowNr          = 0;


            foreach (var question in questions)
            {
                UserControlQuestions ucQuestion = new UserControlQuestions();
                if (question.IsActive == true)
                {
                    ucQuestion.checkBoxDone.Enabled = false;
                    ucQuestion.checkBoxDone.Checked = false;
                }
                else
                {
                    ucQuestion.checkBoxDone.Enabled = false;
                    ucQuestion.checkBoxDone.Checked = true;
                }
                ucQuestion.labelSubject.Text         = question.Title;
                ucQuestion.labelStudent.Text         = question.AskedBy;
                ucQuestion.labelSchoolSubject.Text   = question.Category1;
                ucQuestion.labelTeacher.Text         = question.Category2;
                ucQuestion.labelPriority.Text        = question.Category3;
                ucQuestion.labelAnsweredBy.Text      = question.AnsweredBy;
                ucQuestion.labelPartitionKey.Text    = question.PartitionKey;
                ucQuestion.labelRowKey.Text          = question.RowKey;
                ucQuestion.labelPartitionKey.Visible = false;
                ucQuestion.labelRowKey.Visible       = false;
                ucQuestion.Top = 300 * rowNr;

                panelQuestions.Controls.Add(ucQuestion);

                rowNr++;
            }
        }
 public UserControlAnswerQuestions(UserControlQuestions UserControlQuestions)
 {
     this.UserControlQuestions = UserControlQuestions;
     InitializeComponent();
 }