Added more options to job changes and elaborated error messages (#775)

* job step type and error message details change

* added newline for both environments

* checked for inner exceptions

* sorted imports
This commit is contained in:
Aditya Bist
2019-03-07 11:42:20 -08:00
committed by GitHub
parent 01bcfd8df9
commit a08666af0f
5 changed files with 71 additions and 22 deletions

View File

@@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
@@ -33,8 +34,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
public const string UrnRetriesAttempted = "RetriesAttempted";
public const string UrnServer = "Server";
internal const string UrnServerTime = "CurrentDate";
public static AgentJobInfo ConvertToAgentJobInfo(JobProperties job)
public static AgentJobInfo ConvertToAgentJobInfo(JobProperties job)
{
return new AgentJobInfo
{
@@ -217,5 +218,20 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
}
return jobs;
}
public static AgentSubSystem ConvertToAgentSubSytem(string subSystem)
{
switch(subSystem)
{
case ("Transact-SQL script (T-SQL"):
return AgentSubSystem.TransactSql;
case ("Operating system (CmdExec)"):
return AgentSubSystem.CmdExec;
case ("PowerShell"):
return AgentSubSystem.PowerShell;
default:
return AgentSubSystem.TransactSql;
}
}
}
}