Exemplo n.º 1
0
        public static XQt0150OutBlock FromQuery(XQt0150 query)
        {
            XQt0150OutBlock block = new XQt0150OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.mdqty       = query.GetFieldData(block.GetBlockName(), "mdqty", 0).ParseLong("mdqty");        // long 9
                block.mdamt       = query.GetFieldData(block.GetBlockName(), "mdamt", 0).ParseLong("mdamt");        // long 18
                block.mdfee       = query.GetFieldData(block.GetBlockName(), "mdfee", 0).ParseLong("mdfee");        // long 18
                block.mdtax       = query.GetFieldData(block.GetBlockName(), "mdtax", 0).ParseLong("mdtax");        // long 18
                block.mdargtax    = query.GetFieldData(block.GetBlockName(), "mdargtax", 0).ParseLong("mdargtax");  // long 18
                block.tmdtax      = query.GetFieldData(block.GetBlockName(), "tmdtax", 0).ParseLong("tmdtax");      // long 18
                block.mdadjamt    = query.GetFieldData(block.GetBlockName(), "mdadjamt", 0).ParseLong("mdadjamt");  // long 18
                block.msqty       = query.GetFieldData(block.GetBlockName(), "msqty", 0).ParseLong("msqty");        // long 9
                block.msamt       = query.GetFieldData(block.GetBlockName(), "msamt", 0).ParseLong("msamt");        // long 18
                block.msfee       = query.GetFieldData(block.GetBlockName(), "msfee", 0).ParseLong("msfee");        // long 18
                block.tmstax      = query.GetFieldData(block.GetBlockName(), "tmstax", 0).ParseLong("tmstax");      // long 18
                block.msadjamt    = query.GetFieldData(block.GetBlockName(), "msadjamt", 0).ParseLong("msadjamt");  // long 18
                block.tqty        = query.GetFieldData(block.GetBlockName(), "tqty", 0).ParseLong("tqty");          // long 9
                block.tamt        = query.GetFieldData(block.GetBlockName(), "tamt", 0).ParseLong("tamt");          // long 18
                block.tfee        = query.GetFieldData(block.GetBlockName(), "tfee", 0).ParseLong("tfee");          // long 18
                block.tottax      = query.GetFieldData(block.GetBlockName(), "tottax", 0).ParseLong("tottax");      // long 18
                block.targtax     = query.GetFieldData(block.GetBlockName(), "targtax", 0).ParseLong("targtax");    // long 18
                block.ttax        = query.GetFieldData(block.GetBlockName(), "ttax", 0).ParseLong("ttax");          // long 18
                block.tadjamt     = query.GetFieldData(block.GetBlockName(), "tadjamt", 0).ParseLong("tadjamt");    // long 18
                block.cts_medosu  = query.GetFieldData(block.GetBlockName(), "cts_medosu", 0).FirstOrDefault();     // char 1
                block.cts_expcode = query.GetFieldData(block.GetBlockName(), "cts_expcode", 0).TrimEnd('?');        // char 12
                block.cts_price   = query.GetFieldData(block.GetBlockName(), "cts_price", 0).TrimEnd('?');          // char 9
                block.cts_middiv  = query.GetFieldData(block.GetBlockName(), "cts_middiv", 0).TrimEnd('?');         // char 2
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Exemplo n.º 2
0
        public XQt0150OutBlock GetBlock()
        {
            XQt0150OutBlock instance = XQt0150OutBlock.FromQuery(this);

            return(instance);
        }