public static XQt0441OutBlock FromQuery(XQt0441 query) { XQt0441OutBlock block = new XQt0441OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.tdtsunik = query.GetFieldData(block.GetBlockName(), "tdtsunik", 0).ParseLong("tdtsunik"); // long 18 block.cts_expcode = query.GetFieldData(block.GetBlockName(), "cts_expcode", 0).TrimEnd('?'); // char 8 block.cts_medocd = query.GetFieldData(block.GetBlockName(), "cts_medocd", 0).FirstOrDefault(); // char 1 block.tappamt = query.GetFieldData(block.GetBlockName(), "tappamt", 0).ParseLong("tappamt"); // long 18 block.tsunik = query.GetFieldData(block.GetBlockName(), "tsunik", 0).ParseLong("tsunik"); // long 18 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XQt0441OutBlock GetBlock() { XQt0441OutBlock instance = XQt0441OutBlock.FromQuery(this); return(instance); }