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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 特殊信息查询
    /// 获取某些信息的记录是否存在，状态是否正常等
    /// </summary>
    public class QuerySpecialInfo : TFOutput
    {
        #region Output
        /// <summary>
        /// 本行支付密码器出售标志 0680
        /// 本行支付密码器的出售标志(操作方式为1时)Y.有N.无
        /// </summary>
        public string CSBZ { get; internal set; }

        /// <summary>
        /// 账号开通银信通次数 0500
        /// 账号开通银信通次数(操作方式为2时)
        /// </summary>
        public string YXTCS { get; internal set; }

        /// <summary>
        /// 凭证所属客户号 0280
        /// (操作方式为1时)
        /// </summary>
        public string SSKHH { get; internal set; }

        /// <summary>
        /// 输入账号与凭证账号关系 0690
        /// 1.同一账号2.同一客户账户3.非同一客户账户(操作方式为1时)
        /// </summary>
        public string ZHGX { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 凭证号码 0580
            /// 凭证号码(操作方式为1时) 
            /// </summary>
            public string PZHM { get; set; }

            /// <summary>
            /// 操作方式 0670
            /// 1.本行支付密码器是否已做出售交易2.银信通签约次数 
            /// </summary>
            public string CZFS { get; set; }

            /// <summary>
            /// 账号 0300
            /// 账号(操作方式为1或2时) 
            /// </summary>
            public string ZH { get; set; }

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


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QuerySpecialInfo();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K066";
                MessageData.Fd58 = PZHM;
                MessageData.Fd67 = CZFS;
                MessageData.Fd30 = ZH;
                MessageData.Fd89 = PZLX;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.CSBZ = (MessageData.Fd68);
                output.YXTCS = (MessageData.Fd50);
                output.SSKHH = (MessageData.Fd28);
                output.ZHGX = (MessageData.Fd69);

                return output;
            }
        }
        #endregion
    }
}
