public static XQt8424OutBlock[] ListFromQuery(XQt8424 query) { int count = query.GetBlockCount(XQt8424OutBlock.BlockName); List <XQt8424OutBlock> list = new List <XQt8424OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt8424OutBlock block = new XQt8424OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.hname = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?'); // char 20 block.upcode = query.GetFieldData(block.GetBlockName(), "upcode", i).TrimEnd('?'); // char 3 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public static XQt8424OutBlock[] ReadFromDB(string tableNamePostfix = null /*, char gubun1 = default */) { using (XQt8424 instance = new XQt8424()) { string tableName = (tableNamePostfix == null) ? "XQt8424OutBlock" : $"XQt8424OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); // if (gubun1 != default) qo.Add("gubun1", gubun1); var outBlock = instance.SelectMany <XQt8424OutBlock>(qo); return(outBlock); } }
public static XQt8424OutBlock[] Get(char gubun1 = default) { using (XQt8424 instance = new XQt8424()) { instance.SetFieldData(XQt8424InBlock.BlockName, XQt8424InBlock.F.gubun1, 0, gubun1.ToString()); // char 1 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlocks(); return(outBlock); } }