Пример #1
0
        public static XQCEXAT11200OutBlock1 FromQuery(XQCEXAT11200 query)
        {
            XQCEXAT11200OutBlock1 block = new XQCEXAT11200OutBlock1();

            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.OrgOrdNo         = query.GetFieldData(block.GetBlockName(), "OrgOrdNo", 0).ParseLong("OrgOrdNo");       // long 10
                block.AcntNo           = query.GetFieldData(block.GetBlockName(), "AcntNo", 0).TrimEnd('?');                  // char 20
                block.Pwd              = query.GetFieldData(block.GetBlockName(), "Pwd", 0).TrimEnd('?');                     // char 8
                block.FnoIsuNo         = query.GetFieldData(block.GetBlockName(), "FnoIsuNo", 0).TrimEnd('?');                // char 12
                block.BnsTpCode        = query.GetFieldData(block.GetBlockName(), "BnsTpCode", 0).FirstOrDefault();           // char 1
                block.ErxPrcCndiTpCode = query.GetFieldData(block.GetBlockName(), "ErxPrcCndiTpCode", 0).FirstOrDefault();    // char 1
                block.OrdPrc           = query.GetFieldData(block.GetBlockName(), "OrdPrc", 0).ParseDouble("OrdPrc");         // double 15.2
                block.MdfyQty          = query.GetFieldData(block.GetBlockName(), "MdfyQty", 0).ParseLong("MdfyQty");         // long 16
                block.OrdCndiPrc       = query.GetFieldData(block.GetBlockName(), "OrdCndiPrc", 0).ParseDouble("OrdCndiPrc"); // double 25.8
                block.CommdaCode       = query.GetFieldData(block.GetBlockName(), "CommdaCode", 0).TrimEnd('?');              // char 2
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }