using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMedicalInsurance.Common
{
    public static class Global
    {
        
        public static IrisConfigue hisConfig;
        public static IrisConfigue insuConfig;
        public static InterfaceInfo inf;
        public static Patients pat;
        public static currentEnvironment curEvt;
        
        //写日志 二次封装
        public static void writeLog(string content)
        {
            string logDir = Global.curEvt.path + "\\Log", logName = DateTime.Now.ToString("yyyy-MM-dd") + "_YB.Log";
            Log log = new Log(logDir, logName);

            string timeLine = "**********" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + "***********" + "\r\n";
            log.Write(timeLine + content);

        }
        public static void writeLog(string tradeName, string inParam, string outParam)
        {
            string logDir = Global.curEvt.path + "\\Log", logName = DateTime.Now.ToString("yyyy-MM-dd") + "_YB.Log";
            Log log = new Log(logDir, logName);

            string content = "****************************交易开始(" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + ")****************************" + "\r\n";
            content = content + "交易名称：" + tradeName + "\r\n";
            content = content + "交易入参：" + inParam + "\r\n";
            content = content + "交易出参：" + outParam + "\r\n";
            //content = content + "****************************交易结束(" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + ")****************************" + "\r\n";
            log.Write(content);
        }

        public static void writeLog_Iris(string tradeName, string inParam, string outParam)
        {
            string logDir = Global.curEvt.path  + "\\Log", logName = DateTime.Now.ToString("yyyy-MM-dd") + "_iris.Log";
            Log log = new Log(logDir, logName);

            string content = "****************************交易开始(" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + ")****************************" + "\r\n";
            content = content + "交易名称：" + tradeName + "\r\n";
            content = content + "交易入参：" + inParam + "\r\n";
            content = content + "交易出参：" + outParam + "\r\n";
            //content = content + "****************************交易结束(" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + ")****************************" + "\r\n";
            log.Write(content);
        }
    }
}
