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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询挂失信息
    /// 通过账号查询挂失相关信息
    /// </summary>
    public class QueryReportLossInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 解挂失标志 0230
        /// 0：未解挂；1：口挂；2：书挂；3：密挂；4：密挂兼书挂 5：印挂 6：申请书挂失
        /// </summary>
        public string JGSBZ { get; internal set; }

        /// <summary>
        /// 挂失标志 0240
        /// 1：口挂；2：书挂；3：密挂；4：密挂兼书挂 5：印挂 6：申请书挂失
        /// </summary>
        public string GSBZ { get; internal set; }

        /// <summary>
        /// 挂失编号 0370
        /// (null)
        /// </summary>
        public string GSBH { get; internal set; }

        /// <summary>
        /// 到期日期 0440
        /// (null)
        /// </summary>
        public string DQRQ { get; internal set; }

        /// <summary>
        /// 挂失日期 0450
        /// (null)
        /// </summary>
        public string GSRQ { get; internal set; }

        /// <summary>
        /// 挂失机构 0910
        /// 
        /// </summary>
        public string GSJG { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 账号 0300
            /// (null) 
            /// </summary>
            public string ZH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryReportLossInformation();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K027";
                MessageData.Fd30 = ZH;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.JGSBZ = DelSpace(MessageData.Fd23);
                output.GSBZ = DelSpace(MessageData.Fd24);
                output.GSBH = DelSpace(MessageData.Fd37);
                output.DQRQ = DelSpace(MessageData.Fd44);
                output.GSRQ = DelSpace(MessageData.Fd45);
                output.GSJG = DelSpace(MessageData.Fd91);

                return output;
            }
        }
        #endregion
    }
}
