public static XQAllOutBlocks Get(char gubun1 = default, char gubun2 = default, string from_date = default, string to_date = default) { using (XQt2814 instance = new XQt2814()) { instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun1, 0, gubun1.ToString()); // char 1 instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun2, 0, gubun2.ToString()); // char 1 instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.from_date, 0, from_date); // char 8 instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.to_date, 0, to_date); // char 8 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 /*, char gubun1 = default,char gubun2 = default,string from_date = default,string to_date = default */) { using (XQt2814 instance = new XQt2814()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt2814OutBlock" : $"XQt2814OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt2814OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt2814OutBlock1" : $"XQt2814OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt2814OutBlock1>(qo); return(results); } }
public static XQt2814OutBlock1[] Get(char gubun1 = default, char gubun2 = default, string from_date = default, string to_date = default) { using (XQt2814 instance = new XQt2814()) { instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun1, 0, gubun1.ToString()); // char 1 instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun2, 0, gubun2.ToString()); // char 1 instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.from_date, 0, from_date); // char 8 instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.to_date, 0, to_date); // char 8 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }
public static XQt2814OutBlock FromQuery(XQt2814 query) { XQt2814OutBlock block = new XQt2814OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.mcode = query.GetFieldData(block.GetBlockName(), "mcode", 0).TrimEnd('?'); // char 8 block.mname = query.GetFieldData(block.GetBlockName(), "mname", 0).TrimEnd('?'); // char 20 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }