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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询社保信息
    /// 根据输入协议编号查询社保信息
    /// </summary>
    public class QuerySocialInsuranceInfo : TFOutput
    {
        #region Output
        /// <summary>
        /// 户名 0250
        /// 
        /// </summary>
        public string HM { get; internal set; }

        /// <summary>
        /// 账号 0310
        /// 
        /// </summary>
        public string ZH { get; internal set; }

        /// <summary>
        /// 证件号码 0620
        /// 
        /// </summary>
        public string ZJHM { get; internal set; }

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

        /// <summary>
        /// 状态 0680
        /// 
        /// </summary>
        public string ZT { get; internal set; }

        /// <summary>
        /// 是否存在 0720
        /// 
        /// </summary>
        public string SFCZ { get; internal set; }

        /// <summary>
        /// 建立机构 0910
        /// 
        /// </summary>
        public string JLJG { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 个人编号 0300
            ///  
            /// </summary>
            public string GRBH { get; set; }

            /// <summary>
            /// 查询标志 0660
            ///  
            /// </summary>
            public string CXBZ { get; set; }

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


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QuerySocialInsuranceInfo();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K062";
                MessageData.Fd30 = GRBH;
                MessageData.Fd66 = CXBZ;
                MessageData.Fd64 = DWBH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.HM = (MessageData.Fd25);
                output.ZH = (MessageData.Fd31);
                output.ZJHM = (MessageData.Fd62);
                output.ZJLX = (MessageData.Fd67);
                output.ZT = (MessageData.Fd68);
                output.SFCZ = (MessageData.Fd72);
                output.JLJG = (MessageData.Fd91);

                return output;
            }
        }
        #endregion
    }
}
