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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询通知登记薄
    /// 通过贷款账号查询通知登记薄
    /// </summary>
    public class QueryNotifyRecords : TFOutput
    {
        #region Output
        /// <summary>
        /// 还款账号 0310
        /// 
        /// </summary>
        public string HKZH { get; internal set; }

        /// <summary>
        /// 还款金额 0390
        /// 
        /// </summary>
        public string HKJE { get; internal set; }

        /// <summary>
        /// 预约支取日期 0440
        /// 
        /// </summary>
        public string YYZQRQ { get; internal set; }

        /// <summary>
        /// 标志位 0740
        /// 第一位：  是否预约[Y:已预约 N:未预约] 	第二位：  是否加息[0：否 1：是]
        /// </summary>
        public string BZW { get; internal set; }

        /// <summary>
        /// 合同利率 0840
        /// 
        /// </summary>
        public string HTLL { get; internal set; }

        /// <summary>
        /// 额外利息计算月数或天数 0490
        /// 
        /// </summary>
        public string EWLXJXS { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 贷款账号 0300
            ///  
            /// </summary>
            public string DKZH { get; set; }


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

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.HKZH = (MessageData.Fd31);
                output.HKJE = (MessageData.Fd39);
                output.YYZQRQ = (MessageData.Fd44);
                output.BZW = (MessageData.Fd74);
                output.HTLL = (MessageData.Fd84);
                output.EWLXJXS = (MessageData.Fd49);

                return output;
            }
        }
        #endregion
    }
}
