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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 冻结止付扣划预判
    /// 冻结止付扣划预判
    /// </summary>
    public class AnticipationFreezeStoppaymentDeduct : TFOutput
    {
        #region Output
        /// <summary>
        /// 可扣划金额 0400
        /// 
        /// </summary>
        public string KKHJE { get; internal set; }

        /// <summary>
        /// 已扣划金额 0410
        /// 
        /// </summary>
        public string YKHJE { 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>
            /// 冻结序号 0350
            ///  
            /// </summary>
            public string DJXH { get; set; }

            /// <summary>
            /// 扣划金额 0400
            ///  
            /// </summary>
            public string KHJE { get; set; }

            /// <summary>
            /// 销户标志 0690
            /// 1:销户 0:不销户 
            /// </summary>
            public string XHBZ { get; set; }

            /// <summary>
            /// 扣划类型 0700
            /// {"冻结扣划", "2" }, { "止付扣划", "4" }, { "直接扣划", "1" }, { "其他扣划", "3" }, {"特殊扣划","5"} 
            /// </summary>
            public string KHLX { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new AnticipationFreezeStoppaymentDeduct();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K058";
                MessageData.Fd31 = ZH;
                MessageData.Fd34 = ZHXH;
                MessageData.Fd35 = DJXH;
                MessageData.Fd40 = KHJE;
                MessageData.Fd69 = XHBZ;
                MessageData.Fd70 = KHLX;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.KKHJE = (MessageData.Fd40);
                output.YKHJE = (MessageData.Fd41);

                return output;
            }
        }
        #endregion
    }
}
