Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GlobalClass1.ReadFromDB("allServices");
- LogModel objLog = new LogModel();
- List<SelectListItem> listOfServices = new List<SelectListItem>();
- foreach (DataRow item in GlobalClass1.serviceTable.Rows)
- {
- listOfServices.Add(new SelectListItem { Text = item["SERVICENAME"].ToString(), Value = item["SERVICEINDEX"].ToString() });
- }
- objLog.NamesList = objLog.GetLogFileNames(directoryPath);
- objLog.ServiceList = listOfServices;
- return View("Logs", objLog);
- }
- catch (Exception e)
- {
- return RedirectToAction("Index", "Error");
- }
- }
- string directoryPath = @"D:Log";
- [HttpPost]
- [ValidateInput(false)]
- public ActionResult Logs(LogModel logFileModel)
- {
- ViewData["UserName"] = Session["Username"].ToString();
- logFileModel.SelectedFileContent = System.IO.File.ReadAllText(Path.Combine(
- directoryPath, logFileModel.SelectedFileName));
- logFileModel.NamesList = logFileModel.GetLogFileNames(directoryPath);
- return View("Logs", logFileModel);
- }
Add Comment
Please, Sign In to add comment