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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 检查客户凭证
    /// 客户凭证查询
    /// </summary>
    public class CheckCustomerCertificate : TFOutput
    {
        #region Output
        /// <summary>
        /// 凭证状态 0700
        /// 0无 1出售未使用 2挂失 3回收 4作废 5使用
        /// </summary>
        public string PZZT { get; internal set; }

        /// <summary>
        /// 出售日期 0440
        /// 
        /// </summary>
        public string CSRQ { get; internal set; }


        #endregion

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

            /// <summary>
            /// 凭证号码 0580
            /// (null) 
            /// </summary>
            public string PZHM { get; set; }

            /// <summary>
            /// 凭证类型 0890
            /// (null) 
            /// </summary>
            public string PZLX { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new CheckCustomerCertificate();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K035";
                MessageData.Fd30 = ZH;
                MessageData.Fd58 = PZHM;
                MessageData.Fd89 = PZLX;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.PZZT = DelSpace(MessageData.Fd70);
                output.CSRQ = DelSpace(MessageData.Fd44);

                return output;
            }
        }
        #endregion
    }
}
