public static XQCEXAQ21200OutBlock2 FromQuery(XQCEXAQ21200 query) { XQCEXAQ21200OutBlock2 block = new XQCEXAQ21200OutBlock2(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.RecCnt = query.GetFieldData(block.GetBlockName(), "RecCnt", 0).ParseLong("RecCnt"); // long 5 block.AcntNm = query.GetFieldData(block.GetBlockName(), "AcntNm", 0).TrimEnd('?'); // char 40 block.QryDt = query.GetFieldData(block.GetBlockName(), "QryDt", 0).TrimEnd('?'); // char 8 block.NowPrc = query.GetFieldData(block.GetBlockName(), "NowPrc", 0).ParseDouble("NowPrc"); // double 15.2 block.OrdAbleQty = query.GetFieldData(block.GetBlockName(), "OrdAbleQty", 0).ParseLong("OrdAbleQty"); // long 16 block.NewOrdAbleQty = query.GetFieldData(block.GetBlockName(), "NewOrdAbleQty", 0).ParseLong("NewOrdAbleQty"); // long 16 block.LqdtOrdAbleQty = query.GetFieldData(block.GetBlockName(), "LqdtOrdAbleQty", 0).ParseLong("LqdtOrdAbleQty"); // long 16 block.UsePreargMgn = query.GetFieldData(block.GetBlockName(), "UsePreargMgn", 0).ParseLong("UsePreargMgn"); // long 16 block.UsePreargMnyMgn = query.GetFieldData(block.GetBlockName(), "UsePreargMnyMgn", 0).ParseLong("UsePreargMnyMgn"); // long 16 block.OrdAbleAmt = query.GetFieldData(block.GetBlockName(), "OrdAbleAmt", 0).ParseLong("OrdAbleAmt"); // long 16 block.MnyOrdAbleAmt = query.GetFieldData(block.GetBlockName(), "MnyOrdAbleAmt", 0).ParseLong("MnyOrdAbleAmt"); // long 16 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XQCEXAQ21200OutBlock2 GetBlock2() { XQCEXAQ21200OutBlock2 instance = XQCEXAQ21200OutBlock2.FromQuery(this); return(instance); }