public JsonResult StartService(string ServiceName)
        {
            JsonResult retValue = null;

            WebLogger.Logger.Info("Started " + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            try
            {
                if (Session["Identification"] != null)
                {
                    WinServiceManger.ServiceControllerStatus status = Global.WinServiceMangerClient.StartService(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);
        }
Esempio n. 2
0
        public WindowsServicesControl()
        {
            _model      = new WindowsServicesModel();
            DataContext = _model;

            SetServiceStatus();
            InitializeComponent();
        }
        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 WindowsServicesControl()
        {
            _model = new WindowsServicesModel();
            _windowsServiceHelper = new WindowsServiceHelper();
            DataContext           = _model;

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                SetRuntimeOptions();
            }
        }
Esempio n. 5
0
        public WindowsServicesControl()
        {
            Wu10Logger.LogInfo("Windows Services initializing.");
            _model = new WindowsServicesModel();
            _windowsServiceHelper = new WindowsServiceHelper();
            DataContext           = _model;

            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                SetRuntimeOptions();
            }
            Wu10Logger.LogInfo("Windows Services initialized.");
        }
        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 ActionResult Index(WindowsServicesModel Model)
 {
     return(View(Model));
 }