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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询ATM收回金额
    /// 根据相关要素，返回ATM可收回现金金额
    /// </summary>
    public class QueryAmountsRecoveredATM : TFOutput
    {
        #region Output
        /// <summary>
        /// ATM可收回金额 0410
        /// (null)
        /// </summary>
        public string ATMKSHJE { get; internal set; }

        /// <summary>
        /// 标志位 0730
        /// 第一位[0]验证是否有可收回金额记录(0-是 1-否)
        /// </summary>
        public string BZW { get; internal set; }

        /// <summary>
        /// ATMTEL
        /// ATM柜员号
        /// </summary>
        public string ATMTEL { get; internal set; }
        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 加钞日期 0460
            /// (null) 
            /// </summary>
            public string JCRQ { get; set; }

            /// <summary>
            /// ATM柜员号 0920
            /// (null) 
            /// </summary>
            public string ATMGYH { get; set; }
            /// <summary>
            /// ATM加钞编号
            /// (null) 
            /// </summary>
            public string ATMJCNO { get; set; }

            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryAmountsRecoveredATM();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K050";
                MessageData.Fd46 = JCRQ;
                MessageData.Fd92 = ATMGYH;
                MessageData.Fd58 = ATMJCNO;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.ATMKSHJE = (MessageData.Fd41);
                output.BZW = (MessageData.Fd73);
                output.ATMTEL = (MessageData.Fd92);
                return output;
            }
        }
        #endregion
    }
}
