public static XQt1717OutBlock[] ListFromQuery(XQt1717 query) { int count = query.GetBlockCount(XQt1717OutBlock.BlockName); List <XQt1717OutBlock> list = new List <XQt1717OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1717OutBlock block = new XQt1717OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.date = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?'); // char 8 block.close = query.GetFieldData(block.GetBlockName(), "close", i).ParseLong("close"); // long 8 block.sign = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault(); // char 1 block.change = query.GetFieldData(block.GetBlockName(), "change", i).ParseLong("change"); // long 8 block.diff = query.GetFieldData(block.GetBlockName(), "diff", i).ParseFloat("diff"); // float 6.2 block.volume = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume"); // long 12 block.tjj0000_vol = query.GetFieldData(block.GetBlockName(), "tjj0000_vol", i).ParseLong("tjj0000_vol"); // long 12 block.tjj0001_vol = query.GetFieldData(block.GetBlockName(), "tjj0001_vol", i).ParseLong("tjj0001_vol"); // long 12 block.tjj0002_vol = query.GetFieldData(block.GetBlockName(), "tjj0002_vol", i).ParseLong("tjj0002_vol"); // long 12 block.tjj0003_vol = query.GetFieldData(block.GetBlockName(), "tjj0003_vol", i).ParseLong("tjj0003_vol"); // long 12 block.tjj0004_vol = query.GetFieldData(block.GetBlockName(), "tjj0004_vol", i).ParseLong("tjj0004_vol"); // long 12 block.tjj0005_vol = query.GetFieldData(block.GetBlockName(), "tjj0005_vol", i).ParseLong("tjj0005_vol"); // long 12 block.tjj0006_vol = query.GetFieldData(block.GetBlockName(), "tjj0006_vol", i).ParseLong("tjj0006_vol"); // long 12 block.tjj0007_vol = query.GetFieldData(block.GetBlockName(), "tjj0007_vol", i).ParseLong("tjj0007_vol"); // long 12 block.tjj0008_vol = query.GetFieldData(block.GetBlockName(), "tjj0008_vol", i).ParseLong("tjj0008_vol"); // long 12 block.tjj0009_vol = query.GetFieldData(block.GetBlockName(), "tjj0009_vol", i).ParseLong("tjj0009_vol"); // long 12 block.tjj0010_vol = query.GetFieldData(block.GetBlockName(), "tjj0010_vol", i).ParseLong("tjj0010_vol"); // long 12 block.tjj0011_vol = query.GetFieldData(block.GetBlockName(), "tjj0011_vol", i).ParseLong("tjj0011_vol"); // long 12 block.tjj0018_vol = query.GetFieldData(block.GetBlockName(), "tjj0018_vol", i).ParseLong("tjj0018_vol"); // long 12 block.tjj0016_vol = query.GetFieldData(block.GetBlockName(), "tjj0016_vol", i).ParseLong("tjj0016_vol"); // long 12 block.tjj0017_vol = query.GetFieldData(block.GetBlockName(), "tjj0017_vol", i).ParseLong("tjj0017_vol"); // long 12 block.tjj0000_dan = query.GetFieldData(block.GetBlockName(), "tjj0000_dan", i).ParseLong("tjj0000_dan"); // long 12 block.tjj0001_dan = query.GetFieldData(block.GetBlockName(), "tjj0001_dan", i).ParseLong("tjj0001_dan"); // long 12 block.tjj0002_dan = query.GetFieldData(block.GetBlockName(), "tjj0002_dan", i).ParseLong("tjj0002_dan"); // long 12 block.tjj0003_dan = query.GetFieldData(block.GetBlockName(), "tjj0003_dan", i).ParseLong("tjj0003_dan"); // long 12 block.tjj0004_dan = query.GetFieldData(block.GetBlockName(), "tjj0004_dan", i).ParseLong("tjj0004_dan"); // long 12 block.tjj0005_dan = query.GetFieldData(block.GetBlockName(), "tjj0005_dan", i).ParseLong("tjj0005_dan"); // long 12 block.tjj0006_dan = query.GetFieldData(block.GetBlockName(), "tjj0006_dan", i).ParseLong("tjj0006_dan"); // long 12 block.tjj0007_dan = query.GetFieldData(block.GetBlockName(), "tjj0007_dan", i).ParseLong("tjj0007_dan"); // long 12 block.tjj0008_dan = query.GetFieldData(block.GetBlockName(), "tjj0008_dan", i).ParseLong("tjj0008_dan"); // long 12 block.tjj0009_dan = query.GetFieldData(block.GetBlockName(), "tjj0009_dan", i).ParseLong("tjj0009_dan"); // long 12 block.tjj0010_dan = query.GetFieldData(block.GetBlockName(), "tjj0010_dan", i).ParseLong("tjj0010_dan"); // long 12 block.tjj0011_dan = query.GetFieldData(block.GetBlockName(), "tjj0011_dan", i).ParseLong("tjj0011_dan"); // long 12 block.tjj0018_dan = query.GetFieldData(block.GetBlockName(), "tjj0018_dan", i).ParseLong("tjj0018_dan"); // long 12 block.tjj0016_dan = query.GetFieldData(block.GetBlockName(), "tjj0016_dan", i).ParseLong("tjj0016_dan"); // long 12 block.tjj0017_dan = query.GetFieldData(block.GetBlockName(), "tjj0017_dan", i).ParseLong("tjj0017_dan"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public static XQt1717OutBlock[] ReadFromDB(string tableNamePostfix = null /*, string shcode = default,char gubun = default,string fromdt = default,string todt = default */) { using (XQt1717 instance = new XQt1717()) { string tableName = (tableNamePostfix == null) ? "XQt1717OutBlock" : $"XQt1717OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); // if (shcode != default) qo.Add("shcode", shcode); // if (gubun != default) qo.Add("gubun", gubun); // if (fromdt != default) qo.Add("fromdt", fromdt); // if (todt != default) qo.Add("todt", todt); var outBlock = instance.SelectMany <XQt1717OutBlock>(qo); return(outBlock); } }
public static XQt1717OutBlock[] Get(string shcode = default, char gubun = default, string fromdt = default, string todt = default) { using (XQt1717 instance = new XQt1717()) { instance.SetFieldData(XQt1717InBlock.BlockName, XQt1717InBlock.F.shcode, 0, shcode); // char 6 instance.SetFieldData(XQt1717InBlock.BlockName, XQt1717InBlock.F.gubun, 0, gubun.ToString()); // char 1 instance.SetFieldData(XQt1717InBlock.BlockName, XQt1717InBlock.F.fromdt, 0, fromdt); // char 8 instance.SetFieldData(XQt1717InBlock.BlockName, XQt1717InBlock.F.todt, 0, todt); // char 8 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlocks(); return(outBlock); } }