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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 查询公共参数表
    /// 通过参数代码查询公共产品参数表
    /// </summary>
    public class QueryPublicParameter : TFOutput
    {
        #region Output
        /// <summary>
        /// 参数值 0300
        /// 
        /// </summary>
        public string CSZ { get; internal set; }


        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 参数序号 0490
            /// com_parm.parm_seqn 
            /// </summary>
            public string CSXH { get; set; }

            /// <summary>
            /// 参数代码 0910
            /// com_parm.parm_code 
            /// </summary>
            public string CSDM { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryPublicParameter();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "K029";
                MessageData.Fd49 = CSXH;
                MessageData.Fd91 = CSDM;

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.CSZ = (MessageData.Fd30);

                return output;
            }
        }
        #endregion
    }
}
