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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询抵质押品入库信息(文件)
    /// 通过抵质押品编号|抵质押品序号|抵质押品名称|抵质押类型|质押单号|当前状态查询抵质押信息
    /// </summary>
    public class QueryCollateralInInfo : TFOutput
    {
        #region Output
        /// <summary>
        /// 返回文件
        /// 抵质押品编号|抵质押品序号|抵质押品名称|抵质押类型|质押单号|当前状态|抵质押金额|
        /// </summary>
        public string FHWJ { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 抵质押类型 0210
            ///  
            /// </summary>
            public string DZYLX { get; set; }

            /// <summary>
            /// 抵质押名称 0250
            ///  
            /// </summary>
            public string DZYMC { get; set; }

            /// <summary>
            /// 质押单号 0300
            ///  
            /// </summary>
            public string DZYDH { get; set; }

            /// <summary>
            /// 抵质押序号 0530
            ///  
            /// </summary>
            public string DZYXH { get; set; }

            /// <summary>
            /// 当前状态 0670
            ///  
            /// </summary>
            public string DQZT { get; set; }

            /// <summary>
            /// 抵质押编号 0860
            ///  
            /// </summary>
            public string DZYBH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryCollateralInInfo();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "CXCL";
                MessageData.Fd21 = DZYLX;
                MessageData.Fd25 = DZYMC;
                MessageData.Fd30 = DZYDH;
                MessageData.Fd53 = DZYXH;
                MessageData.Fd67 = DQZT;
                MessageData.Fd86 = DZYBH;
                MessageData.Fd128 = "0063";

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

                return output;
            }
        }
        #endregion
    }
}
