public static XQt1621OutBlock FromQuery(XQt1621 query) { XQt1621OutBlock block = new XQt1621OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.indcode = query.GetFieldData(block.GetBlockName(), "indcode", 0).TrimEnd('?'); // char 4 block.forcode = query.GetFieldData(block.GetBlockName(), "forcode", 0).TrimEnd('?'); // char 4 block.syscode = query.GetFieldData(block.GetBlockName(), "syscode", 0).TrimEnd('?'); // char 4 block.stocode = query.GetFieldData(block.GetBlockName(), "stocode", 0).TrimEnd('?'); // char 4 block.invcode = query.GetFieldData(block.GetBlockName(), "invcode", 0).TrimEnd('?'); // char 4 block.bancode = query.GetFieldData(block.GetBlockName(), "bancode", 0).TrimEnd('?'); // char 4 block.inscode = query.GetFieldData(block.GetBlockName(), "inscode", 0).TrimEnd('?'); // char 4 block.fincode = query.GetFieldData(block.GetBlockName(), "fincode", 0).TrimEnd('?'); // char 4 block.moncode = query.GetFieldData(block.GetBlockName(), "moncode", 0).TrimEnd('?'); // char 4 block.etccode = query.GetFieldData(block.GetBlockName(), "etccode", 0).TrimEnd('?'); // char 4 block.natcode = query.GetFieldData(block.GetBlockName(), "natcode", 0).TrimEnd('?'); // char 4 block.pefcode = query.GetFieldData(block.GetBlockName(), "pefcode", 0).TrimEnd('?'); // char 4 block.jisucd = query.GetFieldData(block.GetBlockName(), "jisucd", 0).TrimEnd('?'); // char 8 block.jisunm = query.GetFieldData(block.GetBlockName(), "jisunm", 0).TrimEnd('?'); // char 20 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XQt1621OutBlock GetBlock() { XQt1621OutBlock instance = XQt1621OutBlock.FromQuery(this); return(instance); }