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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询账户明细
    /// 查询账户明细
    /// </summary>
    public class QueryAccountDetail : TFOutput
    {
        #region Output
        /// <summary>
        /// 内容列表
        /// 活期：交易日期|摘要|现转|借贷|发生额|余额|交易机构|交易柜员|流水号|交易时间|凭证号|代理人姓名|代理人证件类型|代理人证件号码|，定期：交易日期|摘要|现转|借贷|发生额|余额|交易机构|交易柜员|流水号|交易时间|凭证号|代理人姓名|代理人证件类型|代理人证件号码|，内部：交易日期|摘要|现转|借贷|发生额|余额|交易机构|交易柜员|流水号|交易时间|凭证号|，贷款：交易日期|摘要|现转|借贷|交易类型|发生额|余额|交易机构|交易柜员|流水号|交易时间|
        /// </summary>
        public string NRLB { get; internal set; }


        #endregion

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

            /// <summary>
            /// 起始日期 0440
            ///  
            /// </summary>
            public string QSRQ { get; set; }

            /// <summary>
            /// 截止日期 0450
            ///  
            /// </summary>
            public string JZRQ { get; set; }

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

            /// <summary>
            /// 查询标志 0660
            /// 1活期2定期9内部3贷款 
            /// </summary>
            public string CXBZ { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryAccountDetail();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "CXCL";
                MessageData.Fd38 = ZH;
                MessageData.Fd44 = QSRQ;
                MessageData.Fd45 = JZRQ;
                MessageData.Fd51 = ZHXH;
                MessageData.Fd66 = CXBZ;
                MessageData.Fd128 = "0073";

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

                return output;
            }
        }
        #endregion
    }
}
