public ActionResult AddLog(ErrorLog newLogFile) { ErrorLogsDataHandler dataSource = new ErrorLogsDataHandler(); dataSource.AddErrorLog(newLogFile); return(RedirectToAction("Index")); }
public string AddLog(ErrorLog newLogFile) { ErrorLogsDataHandler dataSource = new ErrorLogsDataHandler(); ErrorModel context = new ErrorModel(); Application app = context.Applications.FirstOrDefault(x => x.appId == newLogFile.Application.appId); if (dataSource.AddErrorLog(newLogFile)) { return(String.Format("Log file added:\n\tApplication: " + app.appName + "\n\tApp Status: " + app.appStatus + "\n\tErrorLog FileName: " + newLogFile.fileName)); } else { return(String.Format("Failed to add Log File for:\n\tApplication: " + app.appName + "\n\tApp Status: " + app.appStatus)); } }