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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询账户冻结信息
    /// 通过账号查询账户冻结信息
    /// </summary>
    public class QueryFreezeAccountInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 计划冻结金额 0400
        /// (null)
        /// </summary>
        public string JHDJJE { get; internal set; }

        /// <summary>
        /// 计划冻结起始日期 0440
        /// (null)
        /// </summary>
        public string JHDJQSRQ { get; internal set; }

        /// <summary>
        /// 到期日期 0450
        /// (null)
        /// </summary>
        public string DQRQ { get; internal set; }

        /// <summary>
        /// 止付种类 0650
        /// CKZM存款证明 JHKH计划扣划 CZZF错帐止付 CKZF存款止付（拉存款）CDNF卡年费止付 STZF: 受托止付 QTZF:其它
        /// </summary>
        public string ZFZL { get; internal set; }

        /// <summary>
        /// 冻结/解冻状态 0690
        /// 0未解除 1解除
        /// </summary>
        public string DJJDZT { get; internal set; }

        /// <summary>
        /// 冻结/止付类型 0700
        /// 1全部冻结/止付 2只进不出 3部分冻结/止付 4交易冻结
        /// </summary>
        public string DJZFLX { get; internal set; }

        /// <summary>
        /// 冻结止付标志 0710
        /// 1冻结 2止付
        /// </summary>
        public string DJZFBZ { get; internal set; }

        /// <summary>
        /// 自动解除标志 0720
        /// Y是 N否
        /// </summary>
        public string ZDJCBZ { get; internal set; }

        /// <summary>
        /// 有效计划冻结金额 0410
        /// 
        /// </summary>
        public string YXJHDJJE { get; internal set; }

        /// <summary>
        /// 有效累计已扣划金额 0420
        /// 
        /// </summary>
        public string YXLJYKHJE { get; internal set; }

        /// <summary>
        /// 法律文书 1135
        /// 
        /// </summary>
        public string FLWS { get; internal set; }

        /// <summary>
        /// 标志位 0730
        /// [空格表示没有查询相关数据]第一位[0]:该笔冻结是否生效 1未生效 0生效;第二位[1]:该账户是否还存在其他冻结/止付 1存在 0不存在
        /// </summary>
        public string BZW { get; internal set; }

        /// <summary>
        /// 冻结执法机关 0680
        /// 1海关2司法3税务4检察院
        /// </summary>
        public string DJZFJG { get; internal set; }


        #endregion

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

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

            /// <summary>
            /// 冻结序号 0350
            /// (null) 
            /// </summary>
            public string DJXH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryFreezeAccountInformation();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K028";
                MessageData.Fd30 = ZH;
                MessageData.Fd34 = ZHXH;
                MessageData.Fd35 = DJXH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.JHDJJE = DelSpace(MessageData.Fd40);
                output.JHDJQSRQ = DelSpace(MessageData.Fd44);
                output.DQRQ = DelSpace(MessageData.Fd45);
                output.ZFZL = DelSpace(MessageData.Fd65);
                output.DJJDZT = DelSpace(MessageData.Fd69);
                output.DJZFLX = DelSpace(MessageData.Fd70);
                output.DJZFBZ = DelSpace(MessageData.Fd71);
                output.ZDJCBZ = DelSpace(MessageData.Fd72);
                output.YXJHDJJE = DelSpace(MessageData.Fd41);
                output.YXLJYKHJE = DelSpace(MessageData.Fd42);
                output.BZW = (MessageData.Fd73);
                output.DJZFJG = DelSpace(MessageData.Fd68);
                output.FLWS = DelSpace(MessageData.Fd113_5);
                return output;
            }
        }
        #endregion
    }
}
