public static XQt1615OutBlock FromQuery(XQt1615 query) { XQt1615OutBlock block = new XQt1615OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.dwvolume = query.GetFieldData(block.GetBlockName(), "dwvolume", 0).ParseLong("dwvolume"); // long 12 block.dwvalue = query.GetFieldData(block.GetBlockName(), "dwvalue", 0).ParseLong("dwvalue"); // long 12 block.djvolume = query.GetFieldData(block.GetBlockName(), "djvolume", 0).ParseLong("djvolume"); // long 12 block.djvalue = query.GetFieldData(block.GetBlockName(), "djvalue", 0).ParseLong("djvalue"); // long 12 block.sum_volume = query.GetFieldData(block.GetBlockName(), "sum_volume", 0).ParseLong("sum_volume"); // long 12 block.sum_value = query.GetFieldData(block.GetBlockName(), "sum_value", 0).ParseLong("sum_value"); // long 12 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public static XQt1615OutBlock1[] ListFromQuery(XQt1615 query) { int count = query.GetBlockCount(XQt1615OutBlock1.BlockName); List <XQt1615OutBlock1> list = new List <XQt1615OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1615OutBlock1 block = new XQt1615OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.hname = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?'); // char 20 block.sv_08 = query.GetFieldData(block.GetBlockName(), "sv_08", i).ParseLong("sv_08"); // long 12 block.sv_17 = query.GetFieldData(block.GetBlockName(), "sv_17", i).ParseLong("sv_17"); // long 12 block.sv_18 = query.GetFieldData(block.GetBlockName(), "sv_18", i).ParseLong("sv_18"); // long 12 block.sv_07 = query.GetFieldData(block.GetBlockName(), "sv_07", i).ParseLong("sv_07"); // 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 ReadFromDB(string tableNamePostfix = null /*, char gubun1 = default,char gubun2 = default */) { using (XQt1615 instance = new XQt1615()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt1615OutBlock" : $"XQt1615OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt1615OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt1615OutBlock1" : $"XQt1615OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt1615OutBlock1>(qo); return(results); } }
public static XQt1615OutBlock1[] Get(char gubun1 = default, char gubun2 = default) { using (XQt1615 instance = new XQt1615()) { instance.SetFieldData(XQt1615InBlock.BlockName, XQt1615InBlock.F.gubun1, 0, gubun1.ToString()); // char 1 instance.SetFieldData(XQt1615InBlock.BlockName, XQt1615InBlock.F.gubun2, 0, gubun2.ToString()); // char 1 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }
public static XQAllOutBlocks Get(char gubun1 = default, char gubun2 = default) { using (XQt1615 instance = new XQt1615()) { instance.SetFieldData(XQt1615InBlock.BlockName, XQt1615InBlock.F.gubun1, 0, gubun1.ToString()); // char 1 instance.SetFieldData(XQt1615InBlock.BlockName, XQt1615InBlock.F.gubun2, 0, gubun2.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); } }