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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询代理单位信息
    /// 根据输入代理单位编号查询信息
    /// </summary>
    public class QueryUnitInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 代理类型 0230
        /// 代理类型
        /// </summary>
        public string DLLX { get; internal set; }

        /// <summary>
        /// 代理单位名称 0250
        /// 代理单位名称
        /// </summary>
        public string DLDWMC { get; internal set; }

        /// <summary>
        /// 银行内部清算户 0300
        /// 银行内部清算户
        /// </summary>
        public string NBQSH { get; internal set; }

        /// <summary>
        /// 对公清算户 0310
        /// 对公清算户
        /// </summary>
        public string DGQSH { get; internal set; }

        /// <summary>
        /// 代理性质 0670
        /// 0 代收 1代付
        /// </summary>
        public string DLXZ { get; internal set; }

        /// <summary>
        /// 状态 0680
        /// 0正常1异常
        /// </summary>
        public string ZT { get; internal set; }

        /// <summary>
        /// 是否存在 0720
        /// 0无1有
        /// </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>
            /// 代理单位编号 0640
            /// 代理单位编号 
            /// </summary>
            public string DLDWBH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryUnitInformation();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K061";
                MessageData.Fd64 = DLDWBH;
                MessageData.Fd66 = "0";

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.DLLX = DelSpace(MessageData.Fd23);
                output.DLDWMC = DelSpace(MessageData.Fd25);
                output.NBQSH = DelSpace(MessageData.Fd30);
                output.DGQSH = DelSpace(MessageData.Fd31);
                output.DLXZ = DelSpace(MessageData.Fd67);
                output.ZT = DelSpace(MessageData.Fd68);
                output.SFCZ = DelSpace(MessageData.Fd72);
                output.JLJG = DelSpace(MessageData.Fd91);

                return output;
            }
        }
        #endregion
    }
}
