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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 根据户名、证件、状态查询分户信息
    /// 根据户名、证件、状态查询分户信息
    /// </summary>
    public class QueryIndividualInfo : TFOutput
    {
        #region Output
        /// <summary>
        /// 内容列表
        /// 存款：账号|账户序号|户名|余额|开户机构|产品名称|开户日期|账户类型 内部：账号|户名|产品名称|余额|账户类型 贷款：账号|序号|户名|产品名称|余额|账户类型
        /// </summary>
        public string NRLB { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 户名 0250
            ///  
            /// </summary>
            public string HM { get; set; }

            /// <summary>
            /// 证件号 0620
            ///  
            /// </summary>
            public string ZJH { get; set; }

            /// <summary>
            /// 证件类型 0660
            ///  
            /// </summary>
            public string ZJLX { get; set; }

            /// <summary>
            /// 科目号 0640
            /// 按科目查询时输入 
            /// </summary>
            public string KMH { get; set; }

            /// <summary>
            /// 账户状态 0670
            ///  
            /// </summary>
            public string ZHZT { get; set; }

            /// <summary>
            /// 查询标志 0690
            /// 1存款2内部3贷款 
            /// </summary>
            public string CXBZ { get; set; }

            /// <summary>
            /// 开户机构 0910
            ///  
            /// </summary>
            public string KHJG { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryIndividualInfo();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "CXCL";
                MessageData.Fd25 = HM;
                MessageData.Fd62 = ZJH;
                MessageData.Fd66 = ZJLX;
                MessageData.Fd64 = KMH;
                MessageData.Fd67 = ZHZT;
                MessageData.Fd69 = CXBZ;
                MessageData.Fd128 = "0071";
                MessageData.Fd91 = KHJG;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.NRLB = MessageData.FileData;

                return output;
            }
        }
        #endregion
    }
}
