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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询保证金利率信息
    /// 根据协议编号和协议类型查询保证金利率登记簿的详细信息
    /// </summary>
    public class QueryDepositInterest : TFOutput
    {
        #region Output
        /// <summary>
        /// 收息账号 0310
        /// (null)
        /// </summary>
        public string SXZH { get; internal set; }

        /// <summary>
        /// 保证金账号 0330
        /// (null)
        /// </summary>
        public string BZJZH { get; internal set; }

        /// <summary>
        /// 保证金金额 0390
        /// (null)
        /// </summary>
        public string BZJJE { get; internal set; }

        /// <summary>
        /// 计息金额 0400
        /// (null)
        /// </summary>
        public string JXJE { get; internal set; }

        /// <summary>
        /// 起息日期 0440
        /// (null)
        /// </summary>
        public string QXRQ { get; internal set; }

        /// <summary>
        /// 到期日期 0450
        /// (null)
        /// </summary>
        public string DQRQ { get; internal set; }

        /// <summary>
        /// 结息日期 0460
        /// (null)
        /// </summary>
        public string JXRQ { get; internal set; }

        /// <summary>
        /// 状态 0660
        /// 1正常 *计息结束 X审批
        /// </summary>
        public string ZT { get; internal set; }

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

        /// <summary>
        /// 利率 0840
        /// (null)
        /// </summary>
        public string LL { get; internal set; }

        /// <summary>
        /// 利率编号 0240
        /// 
        /// </summary>
        public string LLBH { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 协议编号 0320
            /// (null) 
            /// </summary>
            public string XYBH { get; set; }

            /// <summary>
            /// 保证金种类 0670
            /// 1承兑保证金 2保函保证金 
            /// </summary>
            public string BZJZL { get; set; }

            /// <summary>
            /// 状态 0660
            /// 1正常X审批 
            /// </summary>
            public string ZT { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryDepositInterest();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K005";
                MessageData.Fd32 = XYBH;
                MessageData.Fd67 = BZJZL;
                MessageData.Fd66 = ZT;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.SXZH = DelSpace(MessageData.Fd31);
                output.BZJZH = DelSpace(MessageData.Fd33);
                output.BZJJE = DelSpace(MessageData.Fd39);
                output.JXJE = DelSpace(MessageData.Fd40);
                output.QXRQ = DelSpace(MessageData.Fd44);
                output.DQRQ = DelSpace(MessageData.Fd45);
                output.JXRQ = DelSpace(MessageData.Fd46);
                output.ZT = DelSpace(MessageData.Fd66);
                output.SFYJL = DelSpace(MessageData.Fd70);
                output.LL = DelSpace(MessageData.Fd84);
                output.LLBH = DelSpace(MessageData.Fd24);

                return output;
            }
        }
        #endregion
    }
}
