//New ShowCallerInfo overloading method with boolean isException parameter to handle exception and information.
        public static void ShowCallerInfo(string message, Exception ex, [CallerMemberName] string callerName = null, [CallerFilePath] string callerFilePath = null, [CallerLineNumber] int callerLine = -1)
        {
            try
            {
                GlobalProcedures.GlobalProcedures objGlob = new GlobalProcedures.GlobalProcedures(EContext);

                //Delegation instance for GetSessionDetail method
                NonStaticMethodHandler handler1 = new NonStaticMethodHandler(objGlob.GetSessionDetail);
                handler1(out CompanyID, out UserID, out SessionID);

                StringBuilder LogMessage = new StringBuilder();
                string        Log;

                StackTrace StackTrace   = new System.Diagnostics.StackTrace();
                StackFrame Frame        = StackTrace.GetFrames()[1];
                MethodInfo Method       = (MethodInfo)Frame.GetMethod();
                string     MethodName   = Method.Name;
                Type       MethodsClass = Method.DeclaringType;
                String     DateTimeNow  = System.DateTime.Now.ToString();
                LogMessage.AppendLine("DateTime : " + Convert.ToString(DateTimeNow));
                LogMessage.Append(" | Company ID : " + Convert.ToString(CompanyID));
                LogMessage.Append(" | UserID : " + Convert.ToString(UserID));
                LogMessage.Append(" | SessionID : " + Convert.ToString(SessionID));
                LogMessage.Append(" | Class File : " + Convert.ToString(MethodsClass));
                LogMessage.Append(" | Method Name : " + Convert.ToString(MethodName));
                LogMessage.AppendLine(" | Line No : " + Convert.ToString(callerLine));
                LogMessage.AppendLine(" | Message : " + message.ToString());

                Log = "EpicorERPLogInfo";

                if (ex.InnerException != null)
                {
                    LogMessage.AppendLine("" + System.Environment.NewLine + System.Environment.NewLine +
                                          "Error Caught : " + ex.StackTrace + System.Environment.NewLine + System.Environment.NewLine + "## Error Detail ##" +
                                          System.Environment.NewLine + "------------------" + System.Environment.NewLine + "------------------" +
                                          System.Environment.NewLine + System.Environment.NewLine + ex.Message + System.Environment.NewLine + System.Environment.NewLine +
                                          "## Inner Exception ##" + System.Environment.NewLine + "----------------" + System.Environment.NewLine + "----------------"
                                          + System.Environment.NewLine + ex.InnerException.Message);
                }
                else
                {
                    LogMessage.AppendLine("" + System.Environment.NewLine + System.Environment.NewLine +
                                          "Error Caught : " + ex.StackTrace + System.Environment.NewLine + System.Environment.NewLine + "## Error Detail ##" +
                                          System.Environment.NewLine + "------------------" + System.Environment.NewLine + "------------------" +
                                          System.Environment.NewLine + System.Environment.NewLine + ex.Message
                                          + System.Environment.NewLine + System.Environment.NewLine + "## Source ##"
                                          + System.Environment.NewLine
                                          + "------------------"
                                          + System.Environment.NewLine + "------------------" +
                                          System.Environment.NewLine + ex.Source);
                }

                WriteToEventLog(Log, "Application Error ", LogMessage.ToString(), "Error", Convert.ToString(MethodsClass));
            }
            catch (Exception exception)
            {
                throw new BLException("GlobalSysInfo => ShowCallerInfo : " + exception.Message);
            }
        }
        // Write Debug Info to Event Viewer //
        // Methods Used for Log information in Event Viewer//
        // ShowCallerInfo overloading method to work as it is in dlls where it used.
        public static void ShowCallerInfo(string message, [CallerMemberName] string callerName = null, [CallerFilePath] string callerFilePath = null, [CallerLineNumber] int callerLine = -1)
        {
            try
            {
                GlobalProcedures.GlobalProcedures obj = new GlobalProcedures.GlobalProcedures(EContext);

                //Delegation instance for GetSessionDetail method
                NonStaticMethodHandler handler = new NonStaticMethodHandler(obj.GetSessionDetail);
                handler(out CompanyID, out UserID, out SessionID);

                Stcl.Global.GlobalProcedures.GlobalProcedures GlobalProc = new Stcl.Global.GlobalProcedures.GlobalProcedures(EContext);
                string CSharpCodeServerLogSwitch = Convert.ToString(GlobalProc.GetSysParam("CSharpCodeServerLogSwitch"));

                if (CSharpCodeServerLogSwitch.Trim().ToUpper() == "OFF")
                {
                    IsActive = false;
                }

                if (IsActive)
                {
                    StringBuilder LogMessage = new StringBuilder();
                    string        Log;
                    string        Event;

                    StackTrace StackTrace      = new System.Diagnostics.StackTrace();
                    StackFrame Frame           = StackTrace.GetFrames()[1];
                    MethodInfo Method          = (MethodInfo)Frame.GetMethod();
                    string     MethodName      = Method.Name;
                    Type       MethodsClass    = Method.DeclaringType;
                    string     SourceClassName = Convert.ToString(MethodsClass);
                    String     DateTimeNow     = System.DateTime.Now.ToString();
                    LogMessage.AppendLine("DateTime : " + Convert.ToString(DateTimeNow));
                    LogMessage.Append(" | Company ID : " + Convert.ToString(CompanyID));
                    LogMessage.Append(" | UserID : " + Convert.ToString(UserID));
                    LogMessage.Append(" | SessionID : " + Convert.ToString(SessionID));
                    LogMessage.Append(" | Class File : " + SourceClassName);
                    LogMessage.Append(" | Method Name : " + Convert.ToString(MethodName));
                    LogMessage.AppendLine(" | Line No : " + Convert.ToString(callerLine));
                    LogMessage.AppendLine(" | Message : " + message.ToString());

                    Log   = "EpicorERPLogInfo";
                    Event = "EpicorERPLogInfo";

                    WriteToEventLog(Log, Event, LogMessage.ToString(), "Information", Convert.ToString(MethodsClass));
                }
            }
            catch (Exception ex)
            {
                throw new BLException("GlobalSysInfo => ShowCallerInfo : " + ex.Message);
            }
        }