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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 合同号查询抵质押信息
    /// 合同号查询抵质押信息
    /// </summary>
    public class QueryCollateralInformationByHTCode : TFOutput
    {
        #region Output
        /// <summary>
        /// 业务类型 0220
        /// 
        /// </summary>
        public string DKLX { get; internal set; }

        /// <summary>
        /// 审批未放款金额 1001
        /// 
        /// </summary>
        public string SPWFKJE { get; internal set; }

        /// <summary>
        /// 已关联金额 1002
        /// 
        /// </summary>
        public string YGLJE { get; internal set; }

        /// <summary>
        /// 已开户未销户抵质押贷款金额 1003
        /// 
        /// </summary>
        public string YKHWXHDZYDKJE { get; internal set; }

        /// <summary>
        /// 该合同下的抵质押贷款余额 1004
        /// 
        /// </summary>
        public string GHTXDDZYDKYE { get; internal set; }

        /// <summary>
        /// 是否有该笔合同 0730
        /// N:没有  Y:有
        /// </summary>
        public string SFYGBHT { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 合同号 0860
            ///  
            /// </summary>
            public string HTH { get; set; }


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

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.DKLX = (MessageData.Fd22);
                output.SPWFKJE = (MessageData.Fd100_1);
                output.YGLJE = (MessageData.Fd100_2);
                output.YKHWXHDZYDKJE = (MessageData.Fd100_3);
                output.GHTXDDZYDKYE = (MessageData.Fd100_4);
                output.SFYGBHT = (MessageData.Fd73);

                return output;
            }
        }
        #endregion
    }
}
