aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-12 02:12:46 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-08-12 02:12:46 +0300
commitbd72c7efe687dfaca6d4fd3c0fc2b5a39d57df55 (patch)
tree0d238b22049d445b40a25ca95f5fef2a1c725bbd /Software/Visual_Studio/FSE/Tango.FSE.Common/SQL
parent3cfc4ee06b801e581107f24e691451cd291b6a70 (diff)
downloadTango-bd72c7efe687dfaca6d4fd3c0fc2b5a39d57df55.tar.gz
Tango-bd72c7efe687dfaca6d4fd3c0fc2b5a39d57df55.zip
More work on proc_doc.
Fixed app crash on code editor selection.
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.Common/SQL')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs22
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs25
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs10
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs50
4 files changed, 104 insertions, 3 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs
index d3b6660bf..e41d864c3 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs
@@ -7,10 +7,32 @@ using Tango.PPC.Shared.SQL;
namespace Tango.FSE.Common.SQL
{
+ /// <summary>
+ /// Represents a remote SQL provider.
+ /// Can be used to execute commands against the remote machine's database and the global twine's database.
+ /// </summary>
+ /// <example>
+ /// <para>
+ /// <i>
+ /// The following example demonstrates how to set the connected machine's demo state and query for the connected machine's jobs.
+ /// </i>
+ /// </para>
+ /// <code lang="C#" source="../Tango.FSE.Procedures/Examples/Sql/Program.cs" title="Remote SQL" region="Example" />
+ /// </example>
public interface IRemoteSqlProvider
{
+ /// <summary>
+ /// Executes the SQL command asynchronously.
+ /// </summary>
+ /// <param name="command">The command.</param>
+ /// <returns>Remote command result.</returns>
Task<RemoteSqlCommandResult> ExecuteSqlCommandAsync(RemoteSqlCommand command);
+ /// <summary>
+ /// Executes the SQL command.
+ /// </summary>
+ /// <param name="command">The command.</param>
+ /// <returns>Remote command result.</returns>
RemoteSqlCommandResult ExecuteSqlCommand(RemoteSqlCommand command);
}
}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs
index 95f94ad08..99d0f1878 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs
@@ -6,12 +6,37 @@ using System.Threading.Tasks;
namespace Tango.FSE.Common.SQL
{
+ /// <summary>
+ /// Represents a SQL command that can be executed by a <see cref="IRemoteSqlProvider"/>.
+ /// </summary>
+ /// <example>
+ /// <para>
+ /// <i>
+ /// The following example demonstrates how to set the connected machine's demo state and query for the connected machine's jobs.
+ /// </i>
+ /// </para>
+ /// <code lang="C#" source="../Tango.FSE.Procedures/Examples/Sql/Program.cs" title="Remote SQL" region="Example" />
+ /// </example>
public class RemoteSqlCommand
{
+ /// <summary>
+ /// Gets or sets the command execution mode.
+ /// </summary>
public RemoteSqlCommandMode Mode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the SQL query.
+ /// </summary>
public String SQL { get; set; }
+
+ /// <summary>
+ /// Gets or sets the command timeout.
+ /// </summary>
public int Timeout { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RemoteSqlCommand"/> class.
+ /// </summary>
public RemoteSqlCommand()
{
Timeout = 30;
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs
index 1b05e8e86..702f35e8a 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs
@@ -7,8 +7,16 @@ using System.Threading.Tasks;
namespace Tango.FSE.Common.SQL
{
/// <summary>
- /// Represents an SQL command mode.
+ /// Represents an SQL command execution mode.
/// </summary>
+ /// <example>
+ /// <para>
+ /// <i>
+ /// The following example demonstrates how to set the connected machine's demo state and query for the connected machine's jobs.
+ /// </i>
+ /// </para>
+ /// <code lang="C#" source="../Tango.FSE.Procedures/Examples/Sql/Program.cs" title="Remote SQL" region="Example" />
+ /// </example>
public enum RemoteSqlCommandMode
{
/// <summary>
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs
index 34ab74a68..da21ae24d 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs
@@ -7,22 +7,68 @@ using Tango.PPC.Shared.SQL;
namespace Tango.FSE.Common.SQL
{
+ /// <summary>
+ /// Represents a <see cref="RemoteSqlCommand"/> result.
+ /// </summary>
+ /// <example>
+ /// <para>
+ /// <i>
+ /// The following example demonstrates how to set the connected machine's demo state and query for the connected machine's jobs.
+ /// </i>
+ /// </para>
+ /// <code lang="C#" source="../Tango.FSE.Procedures/Examples/Sql/Program.cs" title="Remote SQL" region="Example" />
+ /// </example>
public class RemoteSqlCommandResult
{
+ /// <summary>
+ /// Gets or sets the connected machine's database affected records.
+ /// </summary>
public int LocalAffectedRecords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the data set retrieved from the connected machine's database.
+ /// </summary>
public RemoteSqlDataSet LocalDatSet { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the query against the connected machine's database has encountered an error.
+ /// </summary>
public bool HasLocalError { get; set; }
+
+ /// <summary>
+ /// Gets or sets the error encountered by the query when it was executed against the connected machine's database.
+ /// Relevant only if <see cref="HasLocalError"/> equals true.
+ /// </summary>
public String LocalError { get; set; }
+ /// <summary>
+ /// Gets or sets the global database affected records.
+ /// </summary>
public int GlobalAffectedRecords { get; set; }
- public RemoteSqlDataSet GLobalDataSet { get; set; }
+
+ /// <summary>
+ /// Gets or sets the data set retrieved from the global database.
+ /// </summary>
+ public RemoteSqlDataSet GlobalDataSet { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the query against the global database has encountered an error.
+ /// </summary>
public bool HasGlobalError { get; set; }
+
+ /// <summary>
+ /// Gets or sets the error encountered by the query when it was executed against the global database.
+ /// Relevant only if <see cref="HasGlobalError"/> equals true.
+ /// </summary>
public String GlobalError { get; set; }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RemoteSqlCommandResult"/> class.
+ /// </summary>
public RemoteSqlCommandResult()
{
LocalDatSet = new RemoteSqlDataSet();
- GLobalDataSet = new RemoteSqlDataSet();
+ GlobalDataSet = new RemoteSqlDataSet();
}
}
}