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 ATMAmountClearing : TFOutput
    {
        #region Output
        /// <summary>
        /// 清机金额 0400
        /// (null)
        /// </summary>
        public string QJJE { get; internal set; }

        /// <summary>
        /// 标志位 0730
        /// 第一位[0]验证是否有清机记录(0-有 1-无)
        /// </summary>
        public string BZW { get; internal set; }
        /// <summary>
        /// ATM柜员
        /// (null)
        /// </summary>
        public string ATMTEL { get; internal set; }

        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// ATM柜员号 0920
            /// (null) 
            /// </summary>
            public string ATMGYH { get; set; }

            /// <summary>
            /// ATM清钞编号
            /// (null) 
            /// </summary>
            public string ATMQCNO { get; set; }
            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new ATMAmountClearing();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K051";
                MessageData.Fd92 = ATMGYH;
                MessageData.Fd58 = ATMQCNO;
                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.QJJE = (MessageData.Fd40);
                output.BZW = (MessageData.Fd73);
                output.ATMTEL = (MessageData.Fd92);
                return output;
            }
        }
        #endregion
    }
}
