using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 大额查复报文查询
    /// 根据支付行号、委托日期、序号查询大额查复报文信息
    /// </summary>
    public class QueryLargePackets : TFOutput
    {
        #region Output
        /// <summary>
        /// 是否有记录 0660
        /// 0否1是
        /// </summary>
        public string SFYJL { get; internal set; }

        /// <summary>
        /// 应答内容 0950
        /// (null)
        /// </summary>
        public string YDNR { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 委托日期 0450
            /// (null) 
            /// </summary>
            public string WTRQ { get; set; }

            /// <summary>
            /// 发起行行号 0580
            /// (null) 
            /// </summary>
            public string FQXXH { get; set; }

            /// <summary>
            /// 非支付交易序号 0870
            /// (null) 
            /// </summary>
            public string FZFJYXH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryLargePackets();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K008";
                MessageData.Fd45 = WTRQ;
                MessageData.Fd58 = FQXXH;
                MessageData.Fd87 = FZFJYXH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.SFYJL = DelSpace(MessageData.Fd66);
                output.YDNR = (MessageData.Fd95);

                return output;
            }
        }
        #endregion
    }
}
