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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 单笔查询吞卡登记簿
    /// 通过输入卡号查询吞卡信息
    /// </summary>
    public class QuerySingleTunkaRegister : TFOutput
    {
        #region Output
        /// <summary>
        /// 户名 0250
        /// (null)
        /// </summary>
        public string HM { get; internal set; }

        /// <summary>
        /// 吞卡日期 0440
        /// (null)
        /// </summary>
        public string TKRQ { get; internal set; }

        /// <summary>
        /// 证件号码 0620
        /// (null)
        /// </summary>
        public string ZJHM { get; internal set; }

        /// <summary>
        /// 行别 0660
        /// 0本行 1他行
        /// </summary>
        public string XB { get; internal set; }

        /// <summary>
        /// 吞卡类型 0670
        /// 0：普通吞卡 1：指令吞卡 ，指令吞卡不能归还
        /// </summary>
        public string TKLX { get; internal set; }

        /// <summary>
        /// 状态 0680
        /// 1：吞卡 2：已还 3.上缴
        /// </summary>
        public string ZT { get; internal set; }

        /// <summary>
        /// 证件类型 0690
        /// (null)
        /// </summary>
        public string ZJLX { get; internal set; }

        /// <summary>
        /// ATM编号 0730
        /// (null)
        /// </summary>
        public string ATMBH { get; internal set; }

        /// <summary>
        /// 吞卡机构 0910
        /// (null)
        /// </summary>
        public string TKJG { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 卡号 0300
            /// (null) 
            /// </summary>
            public string KH { get; set; }


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

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.HM = (MessageData.Fd25);
                output.TKRQ = (MessageData.Fd44);
                output.ZJHM = (MessageData.Fd62);
                output.XB = (MessageData.Fd66);
                output.TKLX = (MessageData.Fd67);
                output.ZT = (MessageData.Fd68);
                output.ZJLX = (MessageData.Fd69);
                output.ATMBH = (MessageData.Fd73);
                output.TKJG = (MessageData.Fd91);

                return output;
            }
        }
        #endregion
    }
}
