Fix a couple bugs with Alert update (#651)

* Alert bugs WIP

* Alert updates

* Convert tabs to spaces
This commit is contained in:
Karl Burtram
2018-07-06 08:57:07 -07:00
committed by GitHub
parent 21cccd7eaa
commit 5d267303ae
3 changed files with 42 additions and 16 deletions

View File

@@ -468,6 +468,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
{
var result = await ConfigureAgentAlert(
parameters.OwnerUri,
parameters.Alert.Name,
parameters.Alert,
ConfigAction.Create,
RunType.RunNow);
@@ -486,6 +487,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
{
var result = await ConfigureAgentAlert(
parameters.OwnerUri,
parameters.OriginalAlertName,
parameters.Alert,
ConfigAction.Update,
RunType.RunNow);
@@ -504,6 +506,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
{
var result = await ConfigureAgentAlert(
parameters.OwnerUri,
parameters.Alert.Name,
parameters.Alert,
ConfigAction.Drop,
RunType.RunNow);
@@ -881,6 +884,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
internal async Task<Tuple<bool, string>> ConfigureAgentAlert(
string ownerUri,
string alertName,
AgentAlertInfo alert,
ConfigAction configAction,
RunType runType)
@@ -893,11 +897,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
ConnectionServiceInstance.TryFindConnection(ownerUri, out connInfo);
CDataContainer dataContainer = CDataContainer.CreateDataContainer(connInfo, databaseExists: true);
STParameters param = new STParameters(dataContainer.Document);
param.SetParam("alert", alert.Name);
param.SetParam("alert", alertName);
if (alert != null)
{
using (AgentAlertActions agentAlert = new AgentAlertActions(dataContainer, alert, configAction))
using (AgentAlertActions agentAlert = new AgentAlertActions(dataContainer, alertName, alert, configAction))
{
var executionHandler = new ExecutonHandler(agentAlert);
executionHandler.RunNow(runType, this);