public static XQAllOutBlocks Get(string shcode = default, string todt = default, char volvalgb = default, char msmdgb = default, char cumulgb = default, string cts_date = default, long cts_idx = default) { using (XQt1702 instance = new XQt1702()) { instance.SetFieldData(XQt1702InBlock.BlockName, XQt1702InBlock.F.shcode, 0, shcode); // char 6 instance.SetFieldData(XQt1702InBlock.BlockName, XQt1702InBlock.F.todt, 0, todt); // char 8 instance.SetFieldData(XQt1702InBlock.BlockName, XQt1702InBlock.F.volvalgb, 0, volvalgb.ToString()); // char 1 instance.SetFieldData(XQt1702InBlock.BlockName, XQt1702InBlock.F.msmdgb, 0, msmdgb.ToString()); // char 1 instance.SetFieldData(XQt1702InBlock.BlockName, XQt1702InBlock.F.cumulgb, 0, cumulgb.ToString()); // char 1 instance.SetFieldData(XQt1702InBlock.BlockName, XQt1702InBlock.F.cts_date, 0, cts_date); // char 8 instance.SetFieldData(XQt1702InBlock.BlockName, XQt1702InBlock.F.cts_idx, 0, cts_idx.ToString("d4")); // long 4 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); } }
public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, string shcode = default,string todt = default,char volvalgb = default,char msmdgb = default,char cumulgb = default,string cts_date = default,long cts_idx = default */) { using (XQt1702 instance = new XQt1702()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt1702OutBlock" : $"XQt1702OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt1702OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt1702OutBlock1" : $"XQt1702OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt1702OutBlock1>(qo); return(results); } }
public static XQt1702OutBlock1[] ListFromQuery(XQt1702 query) { int count = query.GetBlockCount(XQt1702OutBlock1.BlockName); List <XQt1702OutBlock1> list = new List <XQt1702OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1702OutBlock1 block = new XQt1702OutBlock1(); 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.amt0000 = query.GetFieldData(block.GetBlockName(), "amt0000", i).ParseLong("amt0000"); // long 12 block.amt0001 = query.GetFieldData(block.GetBlockName(), "amt0001", i).ParseLong("amt0001"); // long 12 block.amt0002 = query.GetFieldData(block.GetBlockName(), "amt0002", i).ParseLong("amt0002"); // long 12 block.amt0003 = query.GetFieldData(block.GetBlockName(), "amt0003", i).ParseLong("amt0003"); // long 12 block.amt0004 = query.GetFieldData(block.GetBlockName(), "amt0004", i).ParseLong("amt0004"); // long 12 block.amt0005 = query.GetFieldData(block.GetBlockName(), "amt0005", i).ParseLong("amt0005"); // long 12 block.amt0006 = query.GetFieldData(block.GetBlockName(), "amt0006", i).ParseLong("amt0006"); // long 12 block.amt0007 = query.GetFieldData(block.GetBlockName(), "amt0007", i).ParseLong("amt0007"); // long 12 block.amt0008 = query.GetFieldData(block.GetBlockName(), "amt0008", i).ParseLong("amt0008"); // long 12 block.amt0009 = query.GetFieldData(block.GetBlockName(), "amt0009", i).ParseLong("amt0009"); // long 12 block.amt0010 = query.GetFieldData(block.GetBlockName(), "amt0010", i).ParseLong("amt0010"); // long 12 block.amt0011 = query.GetFieldData(block.GetBlockName(), "amt0011", i).ParseLong("amt0011"); // long 12 block.amt0018 = query.GetFieldData(block.GetBlockName(), "amt0018", i).ParseLong("amt0018"); // long 12 block.amt0088 = query.GetFieldData(block.GetBlockName(), "amt0088", i).ParseLong("amt0088"); // long 12 block.amt0099 = query.GetFieldData(block.GetBlockName(), "amt0099", i).ParseLong("amt0099"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public static XQt1702OutBlock FromQuery(XQt1702 query) { XQt1702OutBlock block = new XQt1702OutBlock(); 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_idx = query.GetFieldData(block.GetBlockName(), "cts_idx", 0).ParseLong("cts_idx"); // long 4 block.cts_date = query.GetFieldData(block.GetBlockName(), "cts_date", 0).TrimEnd('?'); // char 8 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }