using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using TellerSystem.ServiceProxy.Ext.ServiceHelper;

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 
    /// </summary>
    public class CheckGreyList:TFOutput
    {
        #region Output
        /// <summary>
        /// 1 有限制 0 无限制
        /// null
        /// </summary>
        public string Result { get; internal set; }

        /// <summary>
        /// 标志位
        /// bit[0]:0-不限制，1-限制非柜面  bit[1]:0--不限制，1-限制全渠道  bit[2]:0-不限制，1-限制只进不出
        /// </summary>
        public string BZW { get; internal set; }
        #endregion

        #region Input
        /// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {

            /// <summary>
            /// 账号 0300
            /// (null) 
            /// </summary>
            public string ZH { get; set; }

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

            /// <summary>
            /// 证件类型
            /// 
            /// </summary>>
            public string ZJLX { get; set; }

            /// <summary>
            /// 证件号码
            /// (null)
            /// </summary>
            public string ZJHM { get; set; }

            /// <summary>
            /// 客户号
            /// (null)
            /// </summary>>
            public string KHH { get; set; }

            /// <summary>
            /// 单位编号
            /// (null)
            /// </summary>>
            public string DWBH { get; set; }

            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new CheckGreyList();               
                MessageData.BitMapType = TellerSystem.Communication.Message.BitMap.Server;
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
                MessageData.Fd16 = "8857";
                MessageData.Fd28 = KHH;
                MessageData.Fd30 = ZH;
                MessageData.Fd116_4 = ZJLX;
                MessageData.Fd116_5 = ZJHM;
                MessageData.Fd64 = DWBH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    this.TradeAPIs.ShowTip(PageData.TradeAPIs.GetError(MessageData));
                    this.TradeAPIs.SetFocus();
                    return output;
                }
                //output.BZW = (MessageData.Fd73);
                output.Result = MessageData.Fd70.Substring(0, 1); 
                return output;
            }
        }
        #endregion
    }
}
