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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询支付行号信息
    /// 根据输入的支付行号查询行名等信息
    /// </summary>
    public class QueryPayLineNumber : TFOutput
    {
        #region Output
        /// <summary>
        /// 生效日期 0440
        /// (null)
        /// </summary>
        public string SXRQ { get; internal set; }

        /// <summary>
        /// 失效日期 0450
        /// (null)
        /// </summary>
        public string SXRQ_1 { get; internal set; }

        /// <summary>
        /// 是否有记录 0660
        /// 0否1是
        /// </summary>
        public string SFYJL { get; internal set; }

        /// <summary>
        /// 生效标志 0670
        /// 0未生效 1正常 2已失效
        /// </summary>
        public string SXBZ { get; internal set; }

        /// <summary>
        /// 行名全称 0810
        /// (null)
        /// </summary>
        public string XMQC { get; internal set; }

        /// <summary>
        /// 地址 0820
        /// (null)
        /// </summary>
        public string DZ { get; internal set; }

        /// <summary>
        /// 清算行支付行号 0870
        /// (null)
        /// </summary>
        public string QSXZFXH { get; internal set; }

        /// <summary>
        /// 机构名称 0250
        /// 若行号为本行内部行号则返回该行机构名称
        /// </summary>
        public string JGMC { get; internal set; }

        /// <summary>
        /// 是否本行内部行号 0680
        /// 0否1是
        /// </summary>
        public string NBHH { get; internal set; }

        /// <summary>
        /// 机构·号 0910
        /// 若行号为本行内部行号则返回该行机构号
        /// </summary>
        public string JGH { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 大小额支付行号 0860
            /// (null) 
            /// </summary>
            public string DXEZFXH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryPayLineNumber();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K009";
                MessageData.Fd86 = DXEZFXH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.SXRQ = DelSpace(MessageData.Fd44);
                output.SXRQ_1 = DelSpace(MessageData.Fd45);
                output.SFYJL = DelSpace(MessageData.Fd66);
                output.SXBZ = DelSpace(MessageData.Fd67);
                output.XMQC = DelSpace(MessageData.Fd81);
                output.DZ = DelSpace(MessageData.Fd82);
                output.QSXZFXH = DelSpace(MessageData.Fd87);
                output.JGMC = DelSpace(MessageData.Fd25);
                output.NBHH = DelSpace(MessageData.Fd68);
                output.JGH = DelSpace(MessageData.Fd91);

                return output;
            }
        }
        #endregion
    }
}
