public static XQt9907OutBlock1[] ListFromQuery(XQt9907 query) { int count = query.GetBlockCount(XQt9907OutBlock1.BlockName); List <XQt9907OutBlock1> list = new List <XQt9907OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt9907OutBlock1 block = new XQt9907OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.lastym = query.GetFieldData(block.GetBlockName(), "lastym", i).TrimEnd('?'); // char 6 block.lastnm = query.GetFieldData(block.GetBlockName(), "lastnm", i).TrimEnd('?'); // char 10 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public static XQt9907OutBlock1[] ReadFromDB(string tableNamePostfix = null /*, char dummy = default */) { using (XQt9907 instance = new XQt9907()) { string tableName = (tableNamePostfix == null) ? "XQt9907OutBlock1" : $"XQt9907OutBlock1_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); // if (dummy != default) qo.Add("dummy", dummy); var outBlock = instance.SelectMany <XQt9907OutBlock1>(qo); return(outBlock); } }
public static XQt9907OutBlock1[] Get(char dummy = default) { using (XQt9907 instance = new XQt9907()) { instance.SetFieldData(XQt9907InBlock.BlockName, XQt9907InBlock.F.dummy, 0, dummy.ToString()); // char 1 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }