/// <summary> /// OMR項目の値を取得する /// </summary> /// <param name="groupitem"></param> /// <returns></returns> private string getOmrItemValue(OutputFileCGViewDto groupitem) { var omrItems = from x in this.groupDetailItemList where x.ClId == groupitem.ClId && x.ClGroupId == groupitem.ClGroupId && x.TemplateId == groupitem.TemplateId && x.PageNo == groupitem.PageNo orderby x.ItemOrder select x; string value = this.convertToNarrow(groupitem.CorrectedString); string joinValue = string.Empty; int index = 0; //OMR未選択時の出力値を取得する string notMarkString = Config.GetOmrNotMarkOpString(); // OMR出力時の区切り文字 string omrSpliter = Config.GetOmrSplitString(); foreach (var omrItem in omrItems) { if (index < value.Length) { string mark = value.Substring(index, 1); string markString = omrItem.OpString; if (string.IsNullOrEmpty(markString)) { markString = mark; } int digit = 0; if (!int.TryParse(omrItem.RcDigit, out digit)) { digit = 0; } if (mark.Equals("1")) { joinValue += this.padValue(markString, digit); } else { joinValue += this.padValue(notMarkString, digit); } if (this.outputDesignInfo.RcResultOpFormat != Definition.OpDesignFileFormat.Plain) { if (index < value.Length - 1) { joinValue += omrSpliter; } } } index++; } return(joinValue); }
/// <summary> /// グループ項目の値を取得する /// </summary> /// <param name="templateId"></param> /// <param name="clGroupId"></param> /// <param name="pageNo"></param> /// <returns></returns> private string getGroupItemValue(string templateId, string clGroupId, int pageNo) { try { OutputFileCGViewDto item = (from x in this.groupItemResultList where (x.ClGroupId == clGroupId && x.TemplateId == templateId && (x.PageNo == pageNo || pageNo == 0)) select x).Single(); if (item.ItemKind != Definition.ItemKind.OMR) { return(item.CorrectedString); } else { //OMR項目の場合、OMR出力文字列で変換する return(this.getOmrItemValue(item)); } } catch (Exception) { return(string.Empty); } }