public static XQAllOutBlocks Get(string shcode = default, char futcheck = default, string date = default, string cts_code = default, string lastdate = default, int cnt = default) { using (XQt2805 instance = new XQt2805()) { instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.shcode, 0, shcode); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.futcheck, 0, futcheck.ToString()); // char 1 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.date, 0, date); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.cts_code, 0, cts_code); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.lastdate, 0, lastdate); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.cnt, 0, cnt.ToString("d3")); // int 3 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,char futcheck = default,string date = default,string cts_code = default,string lastdate = default,int cnt = default */) { using (XQt2805 instance = new XQt2805()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt2805OutBlock" : $"XQt2805OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt2805OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt2805OutBlock1" : $"XQt2805OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt2805OutBlock1>(qo); return(results); } }
public static XQt2805OutBlock1[] Get(string shcode = default, char futcheck = default, string date = default, string cts_code = default, string lastdate = default, int cnt = default) { using (XQt2805 instance = new XQt2805()) { instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.shcode, 0, shcode); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.futcheck, 0, futcheck.ToString()); // char 1 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.date, 0, date); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.cts_code, 0, cts_code); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.lastdate, 0, lastdate); // char 8 instance.SetFieldData(XQt2805InBlock.BlockName, XQt2805InBlock.F.cnt, 0, cnt.ToString("d3")); // int 3 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }
public static XQt2805OutBlock1[] ListFromQuery(XQt2805 query) { int count = query.GetBlockCount(XQt2805OutBlock1.BlockName); List <XQt2805OutBlock1> list = new List <XQt2805OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt2805OutBlock1 block = new XQt2805OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.date = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?'); // char 8 block.open = query.GetFieldData(block.GetBlockName(), "open", i).ParseFloat("open"); // float 6.2 block.high = query.GetFieldData(block.GetBlockName(), "high", i).ParseFloat("high"); // float 6.2 block.low = query.GetFieldData(block.GetBlockName(), "low", i).ParseFloat("low"); // float 6.2 block.close = query.GetFieldData(block.GetBlockName(), "close", i).ParseFloat("close"); // float 6.2 block.sign = query.GetFieldData(block.GetBlockName(), "sign", i).FirstOrDefault(); // char 1 block.change = query.GetFieldData(block.GetBlockName(), "change", i).ParseFloat("change"); // float 6.2 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.diff_vol = query.GetFieldData(block.GetBlockName(), "diff_vol", i).ParseFloat("diff_vol"); // float 10.2 block.openyak = query.GetFieldData(block.GetBlockName(), "openyak", i).ParseLong("openyak"); // long 8 block.openyakupdn = query.GetFieldData(block.GetBlockName(), "openyakupdn", i).ParseLong("openyakupdn"); // long 8 block.value = query.GetFieldData(block.GetBlockName(), "value", i).ParseFloat("value"); // float 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public static XQt2805OutBlock FromQuery(XQt2805 query) { XQt2805OutBlock block = new XQt2805OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.date = query.GetFieldData(block.GetBlockName(), "date", 0).TrimEnd('?'); // char 8 block.cts_code = query.GetFieldData(block.GetBlockName(), "cts_code", 0).TrimEnd('?'); // char 8 block.lastdate = query.GetFieldData(block.GetBlockName(), "lastdate", 0).TrimEnd('?'); // char 8 block.nowfutyn = query.GetFieldData(block.GetBlockName(), "nowfutyn", 0).FirstOrDefault(); // char 1 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }