public ActionResult Index() { WebLogger.Logger.Info("Started " + System.Reflection.MethodInfo.GetCurrentMethod().Name); Session["Identification"] = User.Identity.Name; WindowsServicesModel wsm = new WindowsServicesModel(Session["Identification"].ToString()); WebLogger.Logger.Info("Completed " + System.Reflection.MethodInfo.GetCurrentMethod().Name); return View(wsm); }
public JsonResult GetWindowsServices() { JsonResult retValue = null; WebLogger.Logger.Info("Started " + System.Reflection.MethodInfo.GetCurrentMethod().Name); try { if (Session["Identification"] != null) { WindowsServicesModel wsm = new WindowsServicesModel(Session["Identification"].ToString()); retValue = new JsonResult() { Data = wsm }; } } catch (Exception ex) { WebLogger.Logger.ErrorException("Error ", ex); } WebLogger.Logger.Info("Completed " + System.Reflection.MethodInfo.GetCurrentMethod().Name); return retValue; }
public JsonResult RestartService(string ServiceName) { JsonResult retValue = null; WebLogger.Logger.Info("Started " + System.Reflection.MethodInfo.GetCurrentMethod().Name); try { WinServiceManger.ServiceControllerStatus status = Global.WinServiceMangerClient.RestartService(Session["Identification"].ToString(), ServiceName); //if (status == WinServiceManger.ServiceControllerStatus.Running) //{ WindowsServicesModel wsm = new WindowsServicesModel(Session["Identification"].ToString()); retValue = new JsonResult() { Data = wsm }; //} } catch (Exception ex) { WebLogger.Logger.ErrorException("Error ", ex); } WebLogger.Logger.Info("Completed " + System.Reflection.MethodInfo.GetCurrentMethod().Name); return retValue; }
public ActionResult Index(WindowsServicesModel Model) { return View(Model); }