public bool ShowQuestionSub(int id)
{
//declare
List<CapDemo.DO.Phase> ListPhase;
List<CapDemo.DO.Question> ListQuestion;
List<CapDemo.DO.Answer> ListAnswer;
int idquestion = 0;
int a = 65;
Phase.IDQuestion = id;
ListPhase = PhaseQuestionBl.getquestionByIDQuestion(Phase);
//if (ListPhase != null)
//{
try
{
idquestion = ListPhase.ElementAt(0).IDQuestion;
//show question in phase
Question.IDQuestion = idquestion;
ListQuestion = QuestionBL.GetQuestionByID(Question);
ListAnswer = QuestionBL.GetAnswerByQuestionID(Question);
//////show question on audience screen
if (ListQuestion != null)
{
/////display question on audience screen
lbl_Content.Text = ListQuestion.ElementAt(0).NameQuestion + "\n";
/////question is onechoice type
if (ListQuestion.ElementAt(0).TypeQuestion.ToLower() == "onechoice")
{
for (int h = 0; h < ListAnswer.Count; h++)
{
lbl_Content.Text +="\n"+ Convert.ToChar(a + h).ToString() + ". " + ListAnswer.ElementAt(h).ContentAnswer;
}
}
else
{ //question is multichoice type
if (ListQuestion.ElementAt(0).TypeQuestion.ToLower() == "multichoice")
{
for (int h = 0; h < ListAnswer.Count; h++)
{
lbl_Content.Text += "\n" + Convert.ToChar(a + h).ToString() + ". " + ListAnswer.ElementAt(h).ContentAnswer;
}
}
else
{
//question is short answer type
lbl_Content.Text = ListAnswer.ElementAt(0).ContentAnswer;
}
}
}
string[] NewLine = lbl_Content.Text.Split('\n');
if (NewLine.Length <= 20)
{
lbl_Content.Font = new Font(lbl_Content.Font.FontFamily, 20.0f, lbl_Content.Font.Style);
}
else
{
if (NewLine.Length <= 36)
{
lbl_Content.Font = new Font(lbl_Content.Font.FontFamily, 12.0f, lbl_Content.Font.Style);
}
else
{
lbl_Content.Font = new Font(lbl_Content.Font.FontFamily, 8.0f, lbl_Content.Font.Style);
}
}
return true;
}
catch (Exception)
{
return false;
}
//}
}