public static void sendException(Exception ex, string strFunctionName, string strEmailFrom, string strEmailTo, string strSubject) { string strMachineName = Environment.MachineName; string strOSVersion = Environment.OSVersion.VersionString; string strUsername = Environment.UserName; string strBody = ""; strBody = "There's error with function " + strFunctionName + ". <br/><br/> Error Messages:<br/> " + ex.Message; AMP_Notification.sendEmail(strEmailFrom, strEmailTo, strSubject, strBody); }
public static void sendErrorException(string strEmailFrom, string strEmailTo, string strSubject, AMP_Rules rule, EventInfo evt, Function_Info finfo, Notification_Dep_user dep, int nPrevSnapshotId, int nCurrSnapshotId, string strFunctionName, string logText) { SaveErrorLog(rule, evt, finfo, dep, nPrevSnapshotId, nCurrSnapshotId, strFunctionName, logText); string strBody = ""; strBody = "There's error with function " + strFunctionName + ". <br/><br/> "; strBody = "Department: " + dep.DepartmentDesc + " (" + dep.DepartmentCode + ") <br/> "; strBody = "Department User: "******" /" + dep.EmailAddress + "<br/> "; strBody = "Rule: " + rule.Rule_Name + " (" + rule.RuleId + ") <br/> "; strBody = "Snapshot Previous:" + getSnapshotDateTimeFromId(nPrevSnapshotId) + " (" + nPrevSnapshotId.ToString() + ") <br/>"; strBody = "Snapshot Current:" + getSnapshotDateTimeFromId(nCurrSnapshotId) + " (" + nCurrSnapshotId.ToString() + ") <br/>"; strBody = "Event: " + evt.EventDesc + " (" + evt.EventId.ToString() + ") <br/>"; strBody = "Function: " + finfo.FuncDesc + " <br/><br/>"; strBody += "Error Messages:<br/> " + logText; AMP_Notification.sendEmail(strEmailFrom, strEmailTo, strSubject, strBody); }