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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询交易流水信息
    /// 通过流水号、交易日期、柜员号、账号、账户序号查询交易流水信息
    /// </summary>
    public class QueryTradeSerialInfo : TFOutput
    {
        #region Output
        /// <summary>
        /// 户名 0250
        /// 
        /// </summary>
        public string HM { get; internal set; }

        /// <summary>
        /// 账号 0310
        /// 
        /// </summary>
        public string ZH { get; internal set; }

        /// <summary>
        /// 账户序号 0340
        /// 
        /// </summary>
        public string ZHXH { get; internal set; }

        /// <summary>
        /// 交易金额 0400
        /// 
        /// </summary>
        public string JYJE { get; internal set; }

        /// <summary>
        /// 交易日期 0440
        /// 
        /// </summary>
        public string JYRQ { get; internal set; }

        /// <summary>
        /// 流水号 0520
        /// 
        /// </summary>
        public string LSH { get; internal set; }

        /// <summary>
        /// 流水笔次 0530
        /// 
        /// </summary>
        public string LSBC { get; internal set; }

        /// <summary>
        /// 流水状态 0700
        /// 
        /// </summary>
        public string LSZT { get; internal set; }

        /// <summary>
        /// 交易机构 0910
        /// 
        /// </summary>
        public string JYJG { get; internal set; }

        /// <summary>
        /// 柜员 0920
        /// 
        /// </summary>
        public string GY { get; internal set; }

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


        #endregion

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

            /// <summary>
            /// 账户序号 0340
            ///  
            /// </summary>
            public string ZHXH { get; set; }

            /// <summary>
            /// 原交易日期 0440
            ///  
            /// </summary>
            public string YJYRQ { get; set; }

            /// <summary>
            /// 流水号 0520
            ///  
            /// </summary>
            public string LSH { get; set; }

            /// <summary>
            /// 柜员号 0920
            ///  
            /// </summary>
            public string GYH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryTradeSerialInfo();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K045";
                MessageData.Fd31 = ZH;
                MessageData.Fd34 = ZHXH;
                MessageData.Fd44 = YJYRQ;
                MessageData.Fd52 = LSH;
                MessageData.Fd92 = GYH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.HM = (MessageData.Fd25);
                output.ZH = (MessageData.Fd31);
                output.ZHXH = (MessageData.Fd34);
                output.JYJE = (MessageData.Fd40);
                output.JYRQ = (MessageData.Fd44);
                output.LSH = (MessageData.Fd52);
                output.LSBC = (MessageData.Fd53);
                output.LSZT = (MessageData.Fd70);
                output.JYJG = (MessageData.Fd91);
                output.GY = (MessageData.Fd92);
                output.PZLX = (MessageData.Fd102_3);

                return output;
            }
        }
        #endregion
    }
}
