Ejemplo n.º 1
0
        public M3072Response Query(M3072Request request)
        {
            string requestString = request.ToFixedLengthString(4);

            string responseString = SocketHelper.SendMessage("130.1.9.231", 30002, requestString, Encoding.GetEncoding("gb18030"));//todo ip and encoding

            M3072Response response = Parse(responseString);

            //翻页查询
            while (response.RTN_IND == "1" && response.Details.Count > 0)
            {
                request.RTN_IND  = "1";
                request.APP_SEQ  = response.Details[response.Details.Count - 1].APP_SEQ;
                request.INPUT_DT = response.Details[response.Details.Count - 1].INPUT_DT;

                requestString  = request.ToFixedLengthString(4);
                responseString = SocketHelper.SendMessage("130.1.9.231", 30002, requestString, Encoding.GetEncoding("gb18030"));

                M3072Response responsePage = Parse(responseString);
                responsePage.Details.InsertRange(0, response.Details);
                response = responsePage;
            }

            return(response);
        }
Ejemplo n.º 2
0
        private M3072Response Parse(string responseString)
        {
            M3072Response response = new M3072Response();

            //解析报文头
            response = M3072Response.FromFixedLengthString <M3072Response>(SubstringWide(responseString, 0, 91), 4);
            //解析卡片明细
            int count = 0;

            if (!string.IsNullOrEmpty(response.COUNT))
            {
                count = int.Parse(response.COUNT);
            }
            for (int i = 0; i < count; i++)
            {
                M3072ResponseDetail detail = M3072ResponseDetail.FromFixedLengthString <M3072ResponseDetail>(SubstringWide(responseString, 91 + 192 * i, 192));
                response.Details.Add(detail);
            }

            return(response);
        }
Ejemplo n.º 3
0
        private static void Test3072()
        {
            M3072Request request = new M3072Request();

            request.TRXTYPE = "3072";
            request.RETCODE = "";
            request.BNKNBR  = "6442";
            request.SOURCE  = "CA";
            request.BRN_NO  = "";
            request.OPE_NO  = "";
            request.SEQNO   = "";
            request.IDTYPE  = "01";
            //request.IDNO = "110101198808080036";
            //request.IDTYPE = "49";
            request.IDNO     = "123566446565955325";
            request.RTN_IND  = "";
            request.APP_SEQ  = "";
            request.INPUT_DT = "";
            request.REVS     = "";

            B3072         cup      = new B3072();
            M3072Response response = cup.Query(request);
        }