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

namespace TellerSystem.Contract.Function
{
    /// <summary>
    /// 9598查询-710003-查询现金审批表
    /// 网点提现的审批 拒绝申请 
    /// </summary>
    public class QueryCashApproveList_710003 : TFOutput
    {
        #region Output
        /// <summary>
        /// 查询结果
        /// 文件格式:申请类型|申请金额|申请事由|券别要求|100元金额(完整)|50元金额(完整)|20元金额(完整)|10元金额(完整)|5元金额(完整)|2元金额(完整)|1元金额(完整)|5角金额(完整)|2角金额(完整)|1角金额(完整)|100元金额(损伤)|50元金额(损伤)|20元金额(损伤)|10元金额(损伤)|5元金额(损伤)|2元金额(损伤)|1元金额(损伤)|5角金额(损伤)|2角金额(损伤)|1角金额(损伤)|备注|申请模式
        /// </summary>
        public string CXJG { get; internal set; }

        /// <summary>
        /// 查询结果
        /// 文件格式:申请类型|申请金额|申请事由|券别要求|100元金额(完整)|50元金额(完整)|20元金额(完整)|10元金额(完整)|5元金额(完整)|2元金额(完整)|1元金额(完整)|5角金额(完整)|2角金额(完整)|1角金额(完整)|100元金额(损伤)|50元金额(损伤)|20元金额(损伤)|10元金额(损伤)|5元金额(损伤)|2元金额(损伤)|1元金额(损伤)|5角金额(损伤)|2角金额(损伤)|1角金额(损伤)|备注|申请模式
        /// </summary>
        public List<E_CXJG> CXJGData { get; internal set; }

        /// <summary>
        /// 查询结果
        /// 文件格式:申请类型|申请金额|申请事由|券别要求|100元金额(完整)|50元金额(完整)|20元金额(完整)|10元金额(完整)|5元金额(完整)|2元金额(完整)|1元金额(完整)|5角金额(完整)|2角金额(完整)|1角金额(完整)|100元金额(损伤)|50元金额(损伤)|20元金额(损伤)|10元金额(损伤)|5元金额(损伤)|2元金额(损伤)|1元金额(损伤)|5角金额(损伤)|2角金额(损伤)|1角金额(损伤)|备注|申请模式
        /// </summary>
        public class E_CXJG
        {
            /// <summary>
            /// 申请类型
            /// </summary>
            public string SQLX { get; set; }

            /// <summary>
            /// 申请金额
            /// </summary>
            public string SQJE { get; set; }

            /// <summary>
            /// 申请事由
            /// </summary>
            public string SQSY { get; set; }

            /// <summary>
            /// 券别要求
            /// </summary>
            public string QBYQ { get; set; }

            /// <summary>
            /// 金额100元(完整)
            /// </summary>
            public string JE100YWZ { get; set; }

            /// <summary>
            /// 金额50元(完整)
            /// </summary>
            public string JE50YWZ { get; set; }

            /// <summary>
            /// 金额20元(完整)
            /// </summary>
            public string JE20YWZ { get; set; }

            /// <summary>
            /// 金额10元(完整)
            /// </summary>
            public string JE10YWZ { get; set; }

            /// <summary>
            /// 金额5元(完整)
            /// </summary>
            public string JE5YWZ { get; set; }

            /// <summary>
            /// 金额2元(完整)
            /// </summary>
            public string JE2YWZ { get; set; }

            /// <summary>
            /// 金额1元(完整)
            /// </summary>
            public string JE1YWZ { get; set; }

            /// <summary>
            /// 金额5角(完整)
            /// </summary>
            public string JE5JWZ { get; set; }

            /// <summary>
            /// 金额2角(完整)
            /// </summary>
            public string JE2JWZ { get; set; }

            /// <summary>
            /// 金额1角(完整)
            /// </summary>
            public string JE1JWZ { get; set; }

            /// <summary>
            /// 金额100元(损伤)
            /// </summary>
            public string JE100YSS { get; set; }

            /// <summary>
            /// 金额50元(损伤)
            /// </summary>
            public string JE50YSS { get; set; }

            /// <summary>
            /// 金额20元(损伤)
            /// </summary>
            public string JE20YSS { get; set; }

            /// <summary>
            /// 金额10元(损伤)
            /// </summary>
            public string JE10YSS { get; set; }

            /// <summary>
            /// 金额5元(损伤)
            /// </summary>
            public string JE5YSS { get; set; }

            /// <summary>
            /// 金额2元(损伤)
            /// </summary>
            public string JE2YSS { get; set; }

            /// <summary>
            /// 金额1元(损伤)
            /// </summary>
            public string JE1YSS { get; set; }

            /// <summary>
            /// 金额5角(损伤)
            /// </summary>
            public string JE5JSS { get; set; }

            /// <summary>
            /// 金额2角(损伤)
            /// </summary>
            public string JE2JSS { get; set; }

            /// <summary>
            /// 金额1角(损伤)
            /// </summary>
            public string JE1JSS { get; set; }

            /// <summary>
            /// 备注
            /// </summary>
            public string BZ { get; set; }

            /// <summary>
            /// 申请模式
            /// </summary>
            public string SQMS { get; set; }

        }

        #endregion

        #region Input
		/// <summary>
        /// 参数清单
        /// </summary>
        public class Input : TFInput
        {
            /// <summary>
            /// 查询条件 
            /// 申请编号
            /// </summary>
            public string SQBH { get; set; }


            /// <summary>                 
            /// 定义业务逻辑              
            /// </summary>                
            /// <returns></returns>  
            public override TFOutput Raise()
            {
                //拉取数据                                  
                var output = new QueryCashApproveList_710003();
                PageData.TradeAPIs.InitFd(MessageData);
                PageData.TradeAPIs.CommSend(MessageData);
				MessageData.Fd126_5 = MainCode;
                MessageData.Fd16 = "9598";
                MessageData.Fd123 = string.Format("1,710001,{0},",SQBH);

                PageData.TradeAPIs.CallServer(MessageData);
                if (MessageData.Fd12 != "0000")
                {
                    output.IsFailed = true;
                    output.FailureCause = PageData.TradeAPIs.GetError(MessageData);
                }                
                output.CXJGData = AnilyzeFileData<E_CXJG>(MessageData.FileData,
                                            "申请类型|申请金额|申请事由|券别要求|金额100元(完整)|金额50元(完整)|金额20元(完整)|金额10元(完整)|金额5元(完整)|金额2元(完整)|金额1元(完整)|金额5角(完整)|金额2角(完整)|金额1角(完整)|金额100元(损伤)|金额50元(损伤)|金额20元(损伤)|金额10元(损伤)|金额5元(损伤)|金额2元(损伤)|金额1元(损伤)|金额5角(损伤)|金额2角(损伤)|金额1角(损伤)|备注|申请模式|",
                                            x =>
                                            {
                                                return new E_CXJG
                                                {
                                                    SQLX = x["申请类型"],
                                                    SQJE = x["申请金额"],
                                                    SQSY = x["申请事由"],
                                                    QBYQ = x["券别要求"],
                                                    JE100YWZ = x["金额100元(完整)"],
                                                    JE50YWZ = x["金额50元(完整)"],
                                                    JE20YWZ = x["金额20元(完整)"],
                                                    JE10YWZ = x["金额10元(完整)"],
                                                    JE5YWZ = x["金额5元(完整)"],
                                                    JE2YWZ = x["金额2元(完整)"],
                                                    JE1YWZ = x["金额1元(完整)"],
                                                    JE5JWZ = x["金额5角(完整)"],
                                                    JE2JWZ = x["金额2角(完整)"],
                                                    JE1JWZ = x["金额1角(完整)"],
                                                    JE100YSS = x["金额100元(损伤)"],
                                                    JE50YSS = x["金额50元(损伤)"],
                                                    JE20YSS = x["金额20元(损伤)"],
                                                    JE10YSS = x["金额10元(损伤)"],
                                                    JE5YSS = x["金额5元(损伤)"],
                                                    JE2YSS = x["金额2元(损伤)"],
                                                    JE1YSS = x["金额1元(损伤)"],
                                                    JE5JSS = x["金额5角(损伤)"],
                                                    JE2JSS = x["金额2角(损伤)"],
                                                    JE1JSS = x["金额1角(损伤)"],
                                                    BZ = x["备注"],
                                                    SQMS = x["申请模式"]
                                                };
                                            });
                output.CXJG = MessageData.FileData;

                return output;
            }
        }
        #endregion
    }
}
