Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagappan Alagappan <nagappan@gmail.com>2006-12-20 18:41:34 +0300
committerNagappan Alagappan <nagappan@gmail.com>2006-12-20 18:41:34 +0300
commit94f2368a0753ced8e5504b3cef70bfc37d633313 (patch)
treeffdaa83e0e9347f261d2f1ebe705f15f1302e940 /mcs/class/Mono.Data.SybaseClient
parent4f27eaaebdf186c76681d6dac4871a19454df54d (diff)
2006-12-20 Nagappan A <anagappan@novell.com>
* Mono.Data.SybaseClient/SybaseRowUpdatedEventArgs.cs (SybaseRowUpdatedEventArgs): Implemeneted constructor. (Command): Implemented property. * Mono.Data.SybaseClient/SybaseCommandBuilder.cs (SybaseCommandBuilder): Implemented constructor. (DataAdapter): Implemented property. (RowUpdatingHandler): Implemented private event handler method. * Mono.Data.SybaseClient/SybaseRowUpdatingEventArgs.cs (Command): Implemented property svn path=/trunk/mcs/; revision=69812
Diffstat (limited to 'mcs/class/Mono.Data.SybaseClient')
-rw-r--r--mcs/class/Mono.Data.SybaseClient/ChangeLog14
-rw-r--r--mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseCommandBuilder.cs48
-rw-r--r--mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatedEventArgs.cs5
-rw-r--r--mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatingEventArgs.cs7
4 files changed, 58 insertions, 16 deletions
diff --git a/mcs/class/Mono.Data.SybaseClient/ChangeLog b/mcs/class/Mono.Data.SybaseClient/ChangeLog
index 878fdceb839..1a982c9e784 100644
--- a/mcs/class/Mono.Data.SybaseClient/ChangeLog
+++ b/mcs/class/Mono.Data.SybaseClient/ChangeLog
@@ -1,3 +1,17 @@
+2006-12-20 Nagappan A <anagappan@novell.com>
+
+ * Mono.Data.SybaseClient/SybaseRowUpdatedEventArgs.cs
+ (SybaseRowUpdatedEventArgs): Implemeneted constructor.
+ (Command): Implemented property.
+
+ * Mono.Data.SybaseClient/SybaseCommandBuilder.cs
+ (SybaseCommandBuilder): Implemented constructor.
+ (DataAdapter): Implemented property.
+ (RowUpdatingHandler): Implemented private event handler method.
+
+ * Mono.Data.SybaseClient/SybaseRowUpdatingEventArgs.cs (Command):
+ Implemented property
+
2005-12-07 Senganal T <tsenganal@novell.com>
* Mono.Data.SybaseClient/SybaseConnection.cs
diff --git a/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseCommandBuilder.cs b/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseCommandBuilder.cs
index d90586086f6..d02dca7eed9 100644
--- a/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseCommandBuilder.cs
+++ b/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseCommandBuilder.cs
@@ -36,25 +36,33 @@ namespace Mono.Data.SybaseClient {
public sealed class SybaseCommandBuilder : Component
{
#region Constructors
+ SybaseDataAdapter adapter;
- [MonoTODO]
- public SybaseCommandBuilder()
+ public SybaseCommandBuilder ()
{
+ adapter = null;
}
- [MonoTODO]
- public SybaseCommandBuilder(SybaseDataAdapter adapter)
+ public SybaseCommandBuilder (SybaseDataAdapter adapter) : this ()
{
+ DataAdapter = adapter;
}
#endregion // Constructors
#region Properties
- [MonoTODO]
public SybaseDataAdapter DataAdapter {
- get { throw new NotImplementedException (); }
- set{ throw new NotImplementedException (); }
+ get { return adapter; }
+ set {
+ if (adapter != null)
+ adapter.RowUpdating -= new SybaseRowUpdatingEventHandler (RowUpdatingHandler);
+
+ adapter = value;
+
+ if (adapter != null)
+ adapter.RowUpdating += new SybaseRowUpdatingEventHandler (RowUpdatingHandler);
+ }
}
[MonoTODO]
@@ -110,6 +118,32 @@ namespace Mono.Data.SybaseClient {
}
#endregion // Methods
+
+ #region Event Handlers
+
+ private void RowUpdatingHandler (object sender, SybaseRowUpdatingEventArgs args)
+ {
+ if (args.Command != null)
+ return;
+ try {
+ switch (args.StatementType) {
+ case StatementType.Insert:
+ args.Command = GetInsertCommand ();
+ break;
+ case StatementType.Update:
+ args.Command = GetUpdateCommand ();
+ break;
+ case StatementType.Delete:
+ args.Command = GetDeleteCommand ();
+ break;
+ }
+ } catch (Exception e) {
+ args.Errors = e;
+ args.Status = UpdateStatus.ErrorsOccurred;
+ }
+
+ #endregion // Event Handlers
+ }
}
}
diff --git a/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatedEventArgs.cs b/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatedEventArgs.cs
index 941a4398e6e..27bc1a31c7f 100644
--- a/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatedEventArgs.cs
+++ b/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatedEventArgs.cs
@@ -37,21 +37,18 @@ namespace Mono.Data.SybaseClient {
{
#region Constructors
- [MonoTODO]
public SybaseRowUpdatedEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
: base (row, command, statementType, tableMapping)
{
- throw new NotImplementedException ();
}
#endregion // Constructors
#region Properties
- [MonoTODO]
public new SybaseCommand Command
{
- get { throw new NotImplementedException (); }
+ get { return (SybaseCommand) base.Command; }
}
#endregion // Properties
diff --git a/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatingEventArgs.cs b/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatingEventArgs.cs
index c108d24720e..f9c4033ce3f 100644
--- a/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatingEventArgs.cs
+++ b/mcs/class/Mono.Data.SybaseClient/Mono.Data.SybaseClient/SybaseRowUpdatingEventArgs.cs
@@ -37,21 +37,18 @@ namespace Mono.Data.SybaseClient {
{
#region Constructors
- [MonoTODO]
public SybaseRowUpdatingEventArgs (DataRow row, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
: base (row, command, statementType, tableMapping)
{
- throw new NotImplementedException ();
}
#endregion // Constructors
#region Properties
- [MonoTODO]
public new SybaseCommand Command {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return (SybaseCommand) base.Command; }
+ set { base.Command = value; }
}
#endregion // Properties