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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 根据支取协议号查询协议相关信息
    /// 根据支取协议号查询协议相关信息
    /// </summary>
    public class QueryZQXYXX : TFOutput
    {
        #region Output
        /// <summary>
        /// 收款户名（对方） 0250
        /// 
        /// </summary>
        public string SKHM { get; internal set; }

        /// <summary>
        /// 审批金额 0390
        /// 
        /// </summary>
        public string SPJE { get; internal set; }

        /// <summary>
        /// 支取协议编号 0620
        /// 
        /// </summary>
        public string XYBH { get; internal set; }

        /// <summary>
        /// 状态 0710
        /// 
        /// </summary>
        public string ZT { get; internal set; }

        /// <summary>
        /// 标志位 0740
        /// 
        /// </summary>
        public string BZW { get; internal set; }

        /// <summary>
        /// 借据号 0860
        /// 
        /// </summary>
        public string JJH { get; internal set; }

        /// <summary>
        /// 收款行号（对方） 0910
        /// 
        /// </summary>
        public string SKHH { get; internal set; }

        /// <summary>
        /// 付款账号 1011
        /// 
        /// </summary>
        public string FKZH { get; internal set; }

        /// <summary>
        /// 收款账号（对方） 1061
        /// 
        /// </summary>
        public string SKZH { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 支取协议编号 0620
            ///  
            /// </summary>
            public string XYBH { get; set; }

            /// <summary>
            /// 借据号 0860
            ///  
            /// </summary>
            public string JJH { get; set; }


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

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.SKHM = (MessageData.Fd25);
                output.SPJE = (MessageData.Fd39);
                output.XYBH = (MessageData.Fd62);
                output.ZT = (MessageData.Fd71);
                output.BZW = (MessageData.Fd74);
                output.JJH = (MessageData.Fd86);
                output.SKHH = (MessageData.Fd91);
                output.FKZH = (MessageData.Fd101_1);
                output.SKZH = (MessageData.Fd106_1);

                return output;
            }
        }
        #endregion
    }
}
