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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 制卡申请预判
    /// 记名卡申请、非记名卡批量制卡申请预判
    /// </summary>
    public class QueryMakeCardApplyJudge : TFOutput
    {
        #region Output

        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 卡序号 0540
            /// 记名卡申请用 
            /// </summary>
            public string KXH { get; set; }

            /// <summary>
            /// 申请数量 0550
            /// 非记名卡申请用 
            /// </summary>
            public string SQSL { get; set; }

            /// <summary>
            /// 操作类型 0670
            ///  1:查询记名卡自选号的序号是否被申请;2:查询记名卡卡号段已经申请的笔数，如果该号段序号不够用，报错;3:查询非记名卡该卡号段已申请的数量，如果该号段序号不够用，报错 
            /// </summary>
            public string CZLX { get; set; }

            /// <summary>
            /// 介质代码 0860
            ///  
            /// </summary>
            public string JZDM { get; set; }

            /// <summary>
            /// 卡号段代码 0870
            ///  
            /// </summary>
            public string KHDDM { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryMakeCardApplyJudge();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K055";
                MessageData.Fd54 = KXH;
                MessageData.Fd55 = SQSL;
                MessageData.Fd67 = CZLX;
                MessageData.Fd86 = JZDM;
                MessageData.Fd87 = KHDDM;

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

                return output;
            }
        }
        #endregion
    }
}
