public static XQt1973OutBlock1[] ListFromQuery(XQt1973 query) { int count = query.GetBlockCount(XQt1973OutBlock1.BlockName); List <XQt1973OutBlock1> list = new List <XQt1973OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1973OutBlock1 block = new XQt1973OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.chetime = query.GetFieldData(block.GetBlockName(), "chetime", i).TrimEnd('?'); // char 8 block.yeprice = query.GetFieldData(block.GetBlockName(), "yeprice", i).ParseLong("yeprice"); // long 8 block.yegubun = query.GetFieldData(block.GetBlockName(), "yegubun", i).FirstOrDefault(); // char 1 block.jnilysign = query.GetFieldData(block.GetBlockName(), "jnilysign", i).FirstOrDefault(); // char 1 block.jnilychange = query.GetFieldData(block.GetBlockName(), "jnilychange", i).ParseLong("jnilychange"); // long 8 block.yediff = query.GetFieldData(block.GetBlockName(), "yediff", i).ParseFloat("yediff"); // float 6.2 block.yevolume = query.GetFieldData(block.GetBlockName(), "yevolume", i).ParseLong("yevolume"); // long 12 block.ymdvolume = query.GetFieldData(block.GetBlockName(), "ymdvolume", i).ParseLong("ymdvolume"); // long 12 block.ymsvolume = query.GetFieldData(block.GetBlockName(), "ymsvolume", i).ParseLong("ymsvolume"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, string shcode = default,string cts_time = default */) { using (XQt1973 instance = new XQt1973()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt1973OutBlock" : $"XQt1973OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt1973OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt1973OutBlock1" : $"XQt1973OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt1973OutBlock1>(qo); return(results); } }
public static XQt1973OutBlock1[] Get(string shcode = default, string cts_time = default) { using (XQt1973 instance = new XQt1973()) { instance.SetFieldData(XQt1973InBlock.BlockName, XQt1973InBlock.F.shcode, 0, shcode); // char 6 instance.SetFieldData(XQt1973InBlock.BlockName, XQt1973InBlock.F.cts_time, 0, cts_time); // char 8 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }
public static XQt1973OutBlock FromQuery(XQt1973 query) { XQt1973OutBlock block = new XQt1973OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.cts_time = query.GetFieldData(block.GetBlockName(), "cts_time", 0).TrimEnd('?'); // char 8 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public static XQAllOutBlocks Get(string shcode = default, string cts_time = default) { using (XQt1973 instance = new XQt1973()) { instance.SetFieldData(XQt1973InBlock.BlockName, XQt1973InBlock.F.shcode, 0, shcode); // char 6 instance.SetFieldData(XQt1973InBlock.BlockName, XQt1973InBlock.F.cts_time, 0, cts_time); // char 8 if (instance.Request() < 0) { return(null); } XQAllOutBlocks results = new XQAllOutBlocks(); results.OutBlock = instance.GetBlock(); if (results.OutBlock.IsValidData == false) { return(null); } results.OutBlock1 = instance.GetBlock1s(); return(results); } }