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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询科目信息
    /// 通过科目号查询科目信息
    /// </summary>
    public class QuerySubjectsInformation : TFOutput
    {
        #region Output
        /// <summary>
        /// 科目名称 0250
        /// (null)
        /// </summary>
        public string KMMC { get; internal set; }

        /// <summary>
        /// 科目控制字 0640
        /// (null)
        /// </summary>
        public string KMKZZ { get; internal set; }

        /// <summary>
        /// 科目借贷标志 0660
        /// 1借 2贷 3两性
        /// </summary>
        public string KMJDBZ { get; internal set; }

        /// <summary>
        /// 科目级别 0670
        /// 1一级科目 2二级科目 3三级科目
        /// </summary>
        public string KMJB { get; internal set; }

        /// <summary>
        /// 科目类型 0680
        /// 0汇总科目 1单户账户科目 2多户账户科目 3无账户科目
        /// </summary>
        public string KMLX { get; internal set; }

        /// <summary>
        /// 发生额方向 0690
        /// 0双方 1借 2贷
        /// </summary>
        public string FSEFX { get; internal set; }

        /// <summary>
        /// 透支标志 0700
        /// N不允许 Y允许
        /// </summary>
        public string TZBZ { get; internal set; }

        /// <summary>
        /// 内部科目标志 0710
        /// D存款账 L贷款账 I内部账 A考核账
        /// </summary>
        public string NBKMBZ { get; internal set; }

        /// <summary>
        /// 表内表外标志 0730
        /// 1表内 2表外
        /// </summary>
        public string BNBWBZ { get; internal set; }

        /// <summary>
        /// 一级科目号 0650
        /// (null)
        /// </summary>
        public string YJKMH { get; internal set; }


        #endregion

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


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

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }
                output.KMMC = (MessageData.Fd25);
                output.KMKZZ = (MessageData.Fd64);
                output.KMJDBZ = (MessageData.Fd66);
                output.KMJB = (MessageData.Fd67);
                output.KMLX = (MessageData.Fd68);
                output.FSEFX = (MessageData.Fd69);
                output.TZBZ = (MessageData.Fd70);
                output.NBKMBZ = (MessageData.Fd71);
                output.BNBWBZ = (MessageData.Fd73);
                output.YJKMH = (MessageData.Fd65);

                return output;
            }
        }
        #endregion
    }
}
