Guest User

Untitled

a guest
Nov 23rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. GlobalClass1.ReadFromDB("allServices");
  2. LogModel objLog = new LogModel();
  3.  
  4. List<SelectListItem> listOfServices = new List<SelectListItem>();
  5.  
  6. foreach (DataRow item in GlobalClass1.serviceTable.Rows)
  7. {
  8. listOfServices.Add(new SelectListItem { Text = item["SERVICENAME"].ToString(), Value = item["SERVICEINDEX"].ToString() });
  9. }
  10. objLog.NamesList = objLog.GetLogFileNames(directoryPath);
  11. objLog.ServiceList = listOfServices;
  12.  
  13. return View("Logs", objLog);
  14. }
  15. catch (Exception e)
  16. {
  17. return RedirectToAction("Index", "Error");
  18. }
  19.  
  20. }
  21. string directoryPath = @"D:Log";
  22.  
  23. [HttpPost]
  24. [ValidateInput(false)]
  25. public ActionResult Logs(LogModel logFileModel)
  26. {
  27. ViewData["UserName"] = Session["Username"].ToString();
  28. logFileModel.SelectedFileContent = System.IO.File.ReadAllText(Path.Combine(
  29. directoryPath, logFileModel.SelectedFileName));
  30. logFileModel.NamesList = logFileModel.GetLogFileNames(directoryPath);
  31. return View("Logs", logFileModel);
  32. }
Add Comment
Please, Sign In to add comment