Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error box to SQL module to improve feedback to users/developers #3

Merged
merged 1 commit into from
Sep 24, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,10 @@
<data name="runasLabel.Help" xml:space="preserve">
<value>Select if the SQL statement does not return a value and only acts on the database to make changes</value>
</data>
<data name="errorLabel.Help" xml:space="preserve">
<value>This is the error returned by SQL server after trying to run your SQL script.</value>
</data>
<data name="errorLabel.Text" xml:space="preserve">
<value>Error Details:</value>
</data>
</root>
5 changes: 4 additions & 1 deletion Website/DesktopModules/Admin/SQL/SQL.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ protected override void OnLoad(EventArgs e)
cmdExecute.Click += OnExecuteClick;
cmdUpload.Click += OnUploadClick;
ResultsRepeater.ItemDataBound += ResultsRepeater_ItemDataBound;
errorRow.Visible = false;

try
{
Expand Down Expand Up @@ -164,7 +165,9 @@ protected void OnExecuteClick(object sender, EventArgs e)
}
else
{
UI.Skins.Skin.AddModuleMessage(this, strError, ModuleMessage.ModuleMessageType.RedError);
UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("QueryError", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
errorRow.Visible = true;
txtError.Text = strError;
}
}
else
Expand Down
4 changes: 4 additions & 0 deletions Website/DesktopModules/Admin/SQL/sql.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<dnn:Label ID="runasLabel" runat="server" ControlName="chkRunAsScript" />
<asp:CheckBox ID="chkRunAsScript" runat="server" />
</div>
<div class="dnnFormItem" runat="server" id="errorRow">
<dnn:Label ID="errorLabel" runat="server" ControlName="txtError" />
<asp:TextBox ID="txtError" runat="server" TextMode="MultiLine" Columns="75" Rows="15" EnableViewState="False" Wrap="False" />
</div>
</fieldset>
<ul class="dnnActions dnnClear">
<li><asp:LinkButton id="cmdExecute" runat="server" CssClass="dnnPrimaryAction" resourcekey="cmdExecute" /></li>
Expand Down