public static XQt8416OutBlock1[] ListFromQuery(XQt8416 query) { int count = query.GetBlockCount(XQt8416OutBlock1.BlockName); List <XQt8416OutBlock1> list = new List <XQt8416OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt8416OutBlock1 block = new XQt8416OutBlock1(); 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.jdiff_vol = query.GetFieldData(block.GetBlockName(), "jdiff_vol", i).ParseLong("jdiff_vol"); // long 12 block.value = query.GetFieldData(block.GetBlockName(), "value", i).ParseLong("value"); // long 12 block.openyak = query.GetFieldData(block.GetBlockName(), "openyak", i).ParseLong("openyak"); // 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 Get(string shcode = default, char gubun = default, long qrycnt = default, string sdate = default, string edate = default, string cts_date = default, char comp_yn = default) { using (XQt8416 instance = new XQt8416()) { instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.shcode, 0, shcode); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.gubun, 0, gubun.ToString()); // char 1 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.qrycnt, 0, qrycnt.ToString("d4")); // long 4 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.sdate, 0, sdate); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.edate, 0, edate); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.cts_date, 0, cts_date); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.comp_yn, 0, comp_yn.ToString()); // char 1 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 gubun = default,long qrycnt = default,string sdate = default,string edate = default,string cts_date = default,char comp_yn = default */) { using (XQt8416 instance = new XQt8416()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt8416OutBlock" : $"XQt8416OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt8416OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt8416OutBlock1" : $"XQt8416OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt8416OutBlock1>(qo); return(results); } }
public static XQt8416OutBlock1[] Get(string shcode = default, char gubun = default, long qrycnt = default, string sdate = default, string edate = default, string cts_date = default, char comp_yn = default) { using (XQt8416 instance = new XQt8416()) { instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.shcode, 0, shcode); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.gubun, 0, gubun.ToString()); // char 1 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.qrycnt, 0, qrycnt.ToString("d4")); // long 4 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.sdate, 0, sdate); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.edate, 0, edate); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.cts_date, 0, cts_date); // char 8 instance.SetFieldData(XQt8416InBlock.BlockName, XQt8416InBlock.F.comp_yn, 0, comp_yn.ToString()); // char 1 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }
public static XQt8416OutBlock FromQuery(XQt8416 query) { XQt8416OutBlock block = new XQt8416OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.shcode = query.GetFieldData(block.GetBlockName(), "shcode", 0).TrimEnd('?'); // char 8 block.jisiga = query.GetFieldData(block.GetBlockName(), "jisiga", 0).ParseFloat("jisiga"); // float 6.2 block.jihigh = query.GetFieldData(block.GetBlockName(), "jihigh", 0).ParseFloat("jihigh"); // float 6.2 block.jilow = query.GetFieldData(block.GetBlockName(), "jilow", 0).ParseFloat("jilow"); // float 6.2 block.jiclose = query.GetFieldData(block.GetBlockName(), "jiclose", 0).ParseFloat("jiclose"); // float 6.2 block.jivolume = query.GetFieldData(block.GetBlockName(), "jivolume", 0).ParseLong("jivolume"); // long 12 block.disiga = query.GetFieldData(block.GetBlockName(), "disiga", 0).ParseFloat("disiga"); // float 6.2 block.dihigh = query.GetFieldData(block.GetBlockName(), "dihigh", 0).ParseFloat("dihigh"); // float 6.2 block.dilow = query.GetFieldData(block.GetBlockName(), "dilow", 0).ParseFloat("dilow"); // float 6.2 block.diclose = query.GetFieldData(block.GetBlockName(), "diclose", 0).ParseFloat("diclose"); // float 6.2 block.highend = query.GetFieldData(block.GetBlockName(), "highend", 0).ParseFloat("highend"); // float 6.2 block.lowend = query.GetFieldData(block.GetBlockName(), "lowend", 0).ParseFloat("lowend"); // float 6.2 block.cts_date = query.GetFieldData(block.GetBlockName(), "cts_date", 0).TrimEnd('?'); // char 8 block.s_time = query.GetFieldData(block.GetBlockName(), "s_time", 0).TrimEnd('?'); // char 6 block.e_time = query.GetFieldData(block.GetBlockName(), "e_time", 0).TrimEnd('?'); // char 6 block.dshmin = query.GetFieldData(block.GetBlockName(), "dshmin", 0).TrimEnd('?'); // char 2 block.rec_count = query.GetFieldData(block.GetBlockName(), "rec_count", 0).ParseLong("rec_count"); // long 7 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }