Run() private method

private Run ( string name ) : void
name string
return void
コード例 #1
0
ファイル: JobServices.cs プロジェクト: michaelburns/LaunchPad
        public void LaunchScriptWithParams(string name, PowerShellParam psParam)
        {
            var jobServices = new JobServices(_scriptRepository);
            //ToDo: Add Logic to Return True / False if successful
            var script = _scriptRepository.GetScriptById(psParam.Id);

            var newJob = new Job()
            {
                UserName = name,
                ScriptId = script.Id,
                Date = DateTime.Now,
                JobId = Int32.Parse(BackgroundJob.Enqueue(() => jobServices.Run(script.Name, psParam.PSparams))),
                Status = Status.Started
            };

            _scriptRepository.InsertJob(newJob);
            _scriptRepository.Save();
        }
コード例 #2
0
        public void LaunchScriptWithParams(string name, PowerShellParam psParam)
        {
            var jobServices = new JobServices(_scriptRepository);
            //ToDo: Add Logic to Return True / False if successful
            var script = _scriptRepository.GetScriptById(psParam.Id);

            var newJob = new Job()
            {
                UserName = name,
                ScriptId = script.Id,
                Date     = DateTime.Now,
                JobId    = Int32.Parse(BackgroundJob.Enqueue(() => jobServices.Run(script.Name, psParam.PSparams))),
                Status   = Status.Started
            };

            _scriptRepository.InsertJob(newJob);
            _scriptRepository.Save();
        }