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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询账户开户信息
    /// 通过账号查询账户开户信息
    /// </summary>
    public class QueryAccountOpeningInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 代理人姓名 0260
        /// (null)
        /// </summary>
        public string LXR1MC { get; internal set; }

        /// <summary>
        /// 代理人电话 0600
        /// (null)
        /// </summary>
        public string LXR1DH { get; internal set; }

        /// <summary>
        /// 代理人证件号码 0620
        /// (null)
        /// </summary>
        public string LXR1ZJHM { get; internal set; }

        /// <summary>
        /// 账户状态 0690
        /// 0：申请；1：开户；2：销户
        /// </summary>
        public string ZHZT { get; internal set; }

        /// <summary>
        /// 代理人证件类型 0700
        /// (null)
        /// </summary>
        public string LXR1ZJLX { get; internal set; }

        /// <summary>
        /// 开户确认退回原因 0820
        /// (null)
        /// </summary>
        public string KHQRTHYY { get; internal set; }

        /// <summary>
        /// 核准号 0880
        /// (null)
        /// </summary>
        public string HZH { get; internal set; }

        /// <summary>
        /// 备案号 0810
        /// (null)
        /// </summary>
        public string BAH { get; internal set; }

        /// <summary>
        /// 信息集合 1230
        /// 根据获取标志获取不同的信息集合
        /// </summary>
        public string XXJH { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 账号 0300
            /// (null) 
            /// </summary>
            public string ZH { get; set; }

            /// <summary>
            /// 获取标志 0660
            /// 1账号联系人信息 
            /// </summary>
            public string HQBZ { get; set; }

            /// <summary>
            /// 账号序号 1022
            ///  
            /// </summary>
            public string ZHXH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryAccountOpeningInformation();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K034";
                MessageData.Fd30 = ZH;
                MessageData.Fd66 = HQBZ;
                MessageData.Fd102_2 = ZHXH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.LXR1MC = (MessageData.Fd26);
                output.LXR1DH = (MessageData.Fd60);
                output.LXR1ZJHM = (MessageData.Fd62);
                output.ZHZT = (MessageData.Fd69);
                output.LXR1ZJLX = (MessageData.Fd70);
                output.KHQRTHYY = (MessageData.Fd82);
                output.HZH = (MessageData.Fd88);
                output.XXJH = (MessageData.Fd123);
                output.BAH = (MessageData.Fd81);

                return output;
            }
        }
        #endregion
    }
}
