private M_QuestionnaireResultDetail CheckBoxToDetail() { if (CheckBoxs == null || !CheckBoxs.Any()) { return(null); } var score = 0; var result = new List <char>(); for (var i = 0; i < CheckBoxs.Length; i++) { if (!CheckBoxs[i].Checked) { continue; } result.Add((char)('A' + i)); score += Convert.ToInt32(CheckBoxs[i].Tag ?? 0); } return(new M_QuestionnaireResultDetail { //QuestionResult = string.Join(",", result) + ",", QuestionResult = !result.Any() ? string.Join(",", result) : string.Join(",", result) + ",", QuestionScore = score, QuestionType = Type, QuestionCode = Code, PQuestionWeightScore = score * Weight }); }
public bool IsUncheckedOrEmpty() { switch (Type) { case 1: return(Radios.Any(p => p.Checked == true)); case 2: return(CheckBoxs.Any(p => p.Checked)); case 3: return(string.IsNullOrEmpty(Text.Text)); //---by hp--- case 4: return(Texts.All(p => !string.IsNullOrEmpty(p.Text)) && Radios.Any(p => p.Checked)); //---by hp end--- default: return(false); } }