/******************************************************************************
 * 文件名称: Global.cs
 * 文件说明: 全局变量及静态方法等
 * 当前版本: V1.0
 * 创建日期: 2022-06-20
 *
 * * 2020-06-20: 增加 Global 类
 * *****  2020-06-20: 增加 CardReader 方法，获取URL地址,USER信息，地方版SSCard.dll使用



******************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PTMedicalInsurance.Common;

namespace PTMedicalInsurance.Variables
{
    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 User user;
        
        //写日志 二次封装
        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 content)
        {
            string logDir = Global.curEvt.path + "\\Log", logName = DateTime.Now.ToString("yyyy-MM-dd") + "_iris.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_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);
        }
    }
}
