public static XQt1662OutBlock[] ReadFromDB(string tableNamePostfix = null /*, char gubun = default,char gubun1 = default,char gubun3 = default */) { using (XQt1662 instance = new XQt1662()) { string tableName = (tableNamePostfix == null) ? "XQt1662OutBlock" : $"XQt1662OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); // if (gubun != default) qo.Add("gubun", gubun); // if (gubun1 != default) qo.Add("gubun1", gubun1); // if (gubun3 != default) qo.Add("gubun3", gubun3); var outBlock = instance.SelectMany <XQt1662OutBlock>(qo); return(outBlock); } }
public static XQt1662OutBlock[] Get(char gubun = default, char gubun1 = default, char gubun3 = default) { using (XQt1662 instance = new XQt1662()) { instance.SetFieldData(XQt1662InBlock.BlockName, XQt1662InBlock.F.gubun, 0, gubun.ToString()); // char 1 instance.SetFieldData(XQt1662InBlock.BlockName, XQt1662InBlock.F.gubun1, 0, gubun1.ToString()); // char 1 instance.SetFieldData(XQt1662InBlock.BlockName, XQt1662InBlock.F.gubun3, 0, gubun3.ToString()); // char 1 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlocks(); return(outBlock); } }
public static XQt1662OutBlock[] ListFromQuery(XQt1662 query) { int count = query.GetBlockCount(XQt1662OutBlock.BlockName); List <XQt1662OutBlock> list = new List <XQt1662OutBlock>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1662OutBlock block = new XQt1662OutBlock(); block.IsValidData = true; block.InvalidReason = ""; try { block.time = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?'); // char 6 block.k200jisu = query.GetFieldData(block.GetBlockName(), "k200jisu", i).ParseFloat("k200jisu"); // 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.k200basis = query.GetFieldData(block.GetBlockName(), "k200basis", i).ParseFloat("k200basis"); // float 6.2 block.tot3 = query.GetFieldData(block.GetBlockName(), "tot3", i).ParseLong("tot3"); // long 12 block.tot1 = query.GetFieldData(block.GetBlockName(), "tot1", i).ParseLong("tot1"); // long 12 block.tot2 = query.GetFieldData(block.GetBlockName(), "tot2", i).ParseLong("tot2"); // long 12 block.cha3 = query.GetFieldData(block.GetBlockName(), "cha3", i).ParseLong("cha3"); // long 12 block.cha1 = query.GetFieldData(block.GetBlockName(), "cha1", i).ParseLong("cha1"); // long 12 block.cha2 = query.GetFieldData(block.GetBlockName(), "cha2", i).ParseLong("cha2"); // long 12 block.bcha3 = query.GetFieldData(block.GetBlockName(), "bcha3", i).ParseLong("bcha3"); // long 12 block.bcha1 = query.GetFieldData(block.GetBlockName(), "bcha1", i).ParseLong("bcha1"); // long 12 block.bcha2 = query.GetFieldData(block.GetBlockName(), "bcha2", i).ParseLong("bcha2"); // long 12 block.volume = query.GetFieldData(block.GetBlockName(), "volume", i).ParseLong("volume"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }