public static XQAllOutBlocks Get(string shcode = default, string traddate1 = default, string traddate2 = default, char fwgubun1 = default, long cts_idx = default) { using (XQt1752 instance = new XQt1752()) { instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.shcode, 0, shcode); // char 6 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.traddate1, 0, traddate1); // char 8 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.traddate2, 0, traddate2); // char 8 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.fwgubun1, 0, fwgubun1.ToString()); // char 1 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.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 XQt1752OutBlock1[] ListFromQuery(XQt1752 query) { int count = query.GetBlockCount(XQt1752OutBlock1.BlockName); List <XQt1752OutBlock1> list = new List <XQt1752OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1752OutBlock1 block = new XQt1752OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.tradname = query.GetFieldData(block.GetBlockName(), "tradname", i).TrimEnd('?'); // char 20 block.tradmdvol = query.GetFieldData(block.GetBlockName(), "tradmdvol", i).ParseLong("tradmdvol"); // long 12 block.tradmsvol = query.GetFieldData(block.GetBlockName(), "tradmsvol", i).ParseLong("tradmsvol"); // long 12 block.tradmssvol = query.GetFieldData(block.GetBlockName(), "tradmssvol", i).ParseLong("tradmssvol"); // long 12 block.wintrd = query.GetFieldData(block.GetBlockName(), "wintrd", i).ParseLong("wintrd"); // long 12 block.winrat = query.GetFieldData(block.GetBlockName(), "winrat", i).ParseFloat("winrat"); // float 6.1 block.tradno = query.GetFieldData(block.GetBlockName(), "tradno", i).TrimEnd('?'); // char 3 block.wgubun = query.GetFieldData(block.GetBlockName(), "wgubun", i).FirstOrDefault(); // char 1 block.swinrat = query.GetFieldData(block.GetBlockName(), "swinrat", i).ParseFloat("swinrat"); // float 6.1 } 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 traddate1 = default,string traddate2 = default,char fwgubun1 = default,long cts_idx = default */) { using (XQt1752 instance = new XQt1752()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt1752OutBlock" : $"XQt1752OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt1752OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt1752OutBlock1" : $"XQt1752OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt1752OutBlock1>(qo); return(results); } }
public static XQt1752OutBlock1[] Get(string shcode = default, string traddate1 = default, string traddate2 = default, char fwgubun1 = default, long cts_idx = default) { using (XQt1752 instance = new XQt1752()) { instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.shcode, 0, shcode); // char 6 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.traddate1, 0, traddate1); // char 8 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.traddate2, 0, traddate2); // char 8 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.fwgubun1, 0, fwgubun1.ToString()); // char 1 instance.SetFieldData(XQt1752InBlock.BlockName, XQt1752InBlock.F.cts_idx, 0, cts_idx.ToString("d4")); // long 4 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }
public static XQt1752OutBlock FromQuery(XQt1752 query) { XQt1752OutBlock block = new XQt1752OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.fwdvl = query.GetFieldData(block.GetBlockName(), "fwdvl", 0).ParseLong("fwdvl"); // long 12 block.fwsvl = query.GetFieldData(block.GetBlockName(), "fwsvl", 0).ParseLong("fwsvl"); // long 12 block.cts_idx = query.GetFieldData(block.GetBlockName(), "cts_idx", 0).ParseLong("cts_idx"); // long 4 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }