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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 密码器验证-临时为特殊用户使用
    /// 密码器验证-临时为特殊用户使用
    /// </summary>
    public class YZMMQ : TFOutput
    {
        #region Output

        #endregion

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

            /// <summary>
            /// 金额 0400
            ///  
            /// </summary>
            public string JE { get; set; }

            /// <summary>
            /// 出票日期 0440
            ///  
            /// </summary>
            public string CPRQ { get; set; }

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

            /// <summary>
            /// 密码 0610
            ///  
            /// </summary>
            public string MM { get; set; }

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


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

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

                return output;
            }
        }
        #endregion
    }
}
