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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询抵质押品信息
    /// 通过合同号查询抵质押品信息
    /// </summary>
    public class QueryCollateralInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 总抵质押金额 0390
        /// 
        /// </summary>
        public string ZDZYJE { get; internal set; }

        /// <summary>
        /// 总抵质押价值 0400
        /// 
        /// </summary>
        public string ZDZYJZ { get; internal set; }

        /// <summary>
        /// 总质押金额 0410
        /// 
        /// </summary>
        public string ZZYJE { get; internal set; }

        /// <summary>
        /// 总抵押金额 0420
        /// 
        /// </summary>
        public string ZDYJE { get; internal set; }

        /// <summary>
        /// 已入库金额 0430
        /// 
        /// </summary>
        public string RKJE { get; internal set; }

        /// <summary>
        /// 是否全部入库 0670
        /// 0-否  1-是
        /// </summary>
        public string SFQBRK { get; internal set; }

        /// <summary>
        /// 累计出库金额 1001
        /// 
        /// </summary>
        public string LJCKJE { get; internal set; }

        /// <summary>
        /// 出库总质押金额 1002
        /// 
        /// </summary>
        public string CKZZYJE { get; internal set; }

        /// <summary>
        /// 出库总抵押金额 1003
        /// 
        /// </summary>
        public string CKZDYJE { get; internal set; }


        #endregion

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


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

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.ZDZYJE = (MessageData.Fd39);
                output.ZDZYJZ = (MessageData.Fd40);
                output.ZZYJE = (MessageData.Fd41);
                output.ZDYJE = (MessageData.Fd42);
                output.RKJE = (MessageData.Fd43);
                output.SFQBRK = (MessageData.Fd67);
                output.LJCKJE = (MessageData.Fd100_1);
                output.CKZZYJE = (MessageData.Fd100_2);
                output.CKZDYJE = (MessageData.Fd100_3);

                return output;
            }
        }
        #endregion
    }
}
