Last active
November 8, 2019 06:19
-
-
Save yvanin/ab40548fc6bf7a1d8a68 to your computer and use it in GitHub Desktop.
Revisions
-
yvanin revised this gist
Apr 17, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public static ActionResult TestDbConnection(Session session) ```xml <Fragment> <UI> <Dialog Id="TestDbConnectionResultDlg" Width="200" Height="80" Title="Testing DB Connection..."> <Control Id="OK" Type="PushButton" X="75" Y="50" Width="56" Height="17" Default="yes" Cancel="yes" Text="OK"> <Publish Event="EndDialog" Value="Return">1</Publish> -
yvanin revised this gist
Apr 17, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ **Custom action (in C# dll)**: ```csharp [CustomAction] public static ActionResult TestDbConnection(Session session) { -
yvanin revised this gist
Apr 17, 2015 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ **Custom action (in C# dll)**: ```c-sharp [CustomAction] public static ActionResult TestDbConnection(Session session) { @@ -17,9 +18,9 @@ public static ActionResult TestDbConnection(Session session) return ActionResult.Success; } } ``` **Popup that will display the test result message (in .wxs file)**: ```xml <Fragment> <UI> ... @@ -31,10 +32,11 @@ public static ActionResult TestDbConnection(Session session) </Dialog> </UI> </Fragment> ``` **Button that will trigger sql connection test (in .wxs file)**: ```xml <Control Id="TestDbConnection" Type="PushButton" X="20" Y="100" Height="16" Width="45" Text="Test"> <Publish Event="SpawnDialog" Value="TestDbConnectionResultDlg" Order="2">1</Publish> <Publish Event="DoAction" Value="TestDbConnection" Order="1">1</Publish> </Control> ``` -
yvanin renamed this gist
Apr 17, 2015 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ **Custom action (in C# dll)**: [CustomAction] public static ActionResult TestDbConnection(Session session) @@ -18,7 +18,7 @@ public static ActionResult TestDbConnection(Session session) } } **Popup that will display the test result message (in .wxs file)**: <Fragment> <UI> @@ -32,9 +32,9 @@ Popup that will display the test result message (in .wxs file): </UI> </Fragment> **Button that will trigger sql connection test (in .wxs file)**: <Control Id="TestDbConnection" Type="PushButton" X="20" Y="100" Height="16" Width="45" Text="Test"> <Publish Event="SpawnDialog" Value="TestDbConnectionResultDlg" Order="2">1</Publish> <Publish Event="DoAction" Value="TestDbConnection" Order="1">1</Publish> </Control> -
yvanin created this gist
Apr 17, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ Custom action (in C# dll): [CustomAction] public static ActionResult TestDbConnection(Session session) { using (var connection = new SqlConnection(session["CONNECTION_STRING"])) { try { connection.Open(); session["TEST_DB_CONNECTION_RESULT"] = "Connection succeeded."; } catch { session["TEST_DB_CONNECTION_RESULT"] = "Connection failed!"; } return ActionResult.Success; } } Popup that will display the test result message (in .wxs file): <Fragment> <UI> ... <Dialog Id="TestDbConnectionResultDlg" Width="200" Height="80" Title="Testing DB Connection..."> <Control Id="OK" Type="PushButton" X="75" Y="50" Width="56" Height="17" Default="yes" Cancel="yes" Text="OK"> <Publish Event="EndDialog" Value="Return">1</Publish> </Control> <Control Id="Text" Type="Text" X="20" Y="12" Width="160" Height="40" Text="[TEST_DB_CONNECTION_RESULT]" /> </Dialog> </UI> </Fragment> Button that will trigger sql connection test (in .wxs file): <Control Id="TestDbConnection" Type="PushButton" X="20" Y="100" Height="16" Width="45" Text="Test"> <Publish Event="SpawnDialog" Value="TestDbConnectionResultDlg" Order="2">1</Publish> <Publish Event="DoAction" Value="TestDbConnection" Order="1">1</Publish> </Control>