public Employment Get(int Id) { try { Logger.LogInfo("GET: Employment process start."); Employment employment = new Employment(); DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_CLIENT_EMPLOYMENT_ID, Id)); foreach (DataRow dr in dtAppConfig.Rows) { employment.ClientEmployment = convertToClientEmploymentObject(dr); } dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_SPOUSE_EMPLOYMENT_ID, Id)); foreach (DataRow dr in dtAppConfig.Rows) { employment.SpouseEmployment = convertToSpouseEmploymentObject(dr); } return(employment); Logger.LogInfo("GET: Employment process completed."); } catch (Exception ex) { DebuggerLogInfo debuggerInfo = new DebuggerLogInfo(); debuggerInfo.ClassName = this.GetType().Name; StackTrace st = new StackTrace(); StackFrame sf = st.GetFrame(0); MethodBase currentMethodName = sf.GetMethod(); debuggerInfo.Method = currentMethodName.Name; debuggerInfo.ExceptionInfo = ex; Logger.LogDebug(debuggerInfo); return(null); } }
private void LogDebug(string methodName, Exception ex) { DebuggerLogInfo debuggerInfo = new DebuggerLogInfo(); debuggerInfo.ClassName = this.GetType().Name; debuggerInfo.Method = methodName; debuggerInfo.ExceptionInfo = ex; Logger.LogDebug(debuggerInfo); }
private static void LogDebug(string methodName, Exception ex) { DebuggerLogInfo debuggerInfo = new DebuggerLogInfo(); debuggerInfo.ClassName = "DataConversion"; debuggerInfo.Method = methodName; debuggerInfo.ExceptionInfo = ex; Logger.LogDebug(debuggerInfo); }