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 QueryATMAccountInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 账面余额 0410
        /// (null)
        /// </summary>
        public string ZMYE { get; internal set; }

        /// <summary>
        /// 长款金额 0420
        /// (null)
        /// </summary>
        public string CKJE { get; internal set; }

        /// <summary>
        /// 短款金额 0430
        /// (null)
        /// </summary>
        public string DKJE { get; internal set; }

        /// <summary>
        /// 标志位 0730
        /// 第一位[0]验证是否有现金付出(0-有 1-无)
        /// </summary>
        public string BZW { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 实缴金额 0390
            /// (null) 
            /// </summary>
            public string SJJE { get; set; }

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


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryATMAccountInformation();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K052";
                MessageData.Fd39 = SJJE;
                MessageData.Fd92 = ATMGYH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.ZMYE = (MessageData.Fd41);
                output.CKJE = (MessageData.Fd42);
                output.DKJE = (MessageData.Fd43);
                output.BZW = (MessageData.Fd73);

                return output;
            }
        }
        #endregion
    }
}
