Provides data for the RowUpdating event. This class cannot be inherited.
Inheritance: System.Data.Common.RowUpdatingEventArgs
Exemplo n.º 1
0
        private void OnRowUpdating(object sender, MySqlRowUpdatingEventArgs args)
        {
            // make sure we are still to proceed
            if (args.Status != UpdateStatus.Continue)
            {
                return;
            }

            if (_schema == null)
            {
                GenerateSchema();
            }

            if (StatementType.Delete == args.StatementType)
            {
                args.Command = CreateDeleteCommand();
            }
            else if (StatementType.Update == args.StatementType)
            {
                args.Command = CreateUpdateCommand();
            }
            else if (StatementType.Insert == args.StatementType)
            {
                args.Command = CreateInsertCommand();
            }
            else if (StatementType.Select == args.StatementType)
            {
                return;
            }

            SetParameterValues(args.Command, args.Row);
        }
Exemplo n.º 2
0
        private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
        {
            RowUpdatingHandler(args);

            if (args.StatementType != StatementType.Insert)
            {
                return;
            }

            if (ReturnGeneratedIdentifiers)
            {
                if (args.Command.UpdatedRowSource != UpdateRowSource.None)
                {
                    throw new InvalidOperationException(
                              Resources.MixingUpdatedRowSource);
                }
                args.Command.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
                if (finalSelect == null)
                {
                    CreateFinalSelect();
                }
            }

            args.Command.CommandText += finalSelect;
        }
Exemplo n.º 3
0
 private void OnRowUpdating(object sender, MySqlRowUpdatingEventArgs e)
 {
     if ((int)e.Status != 0)
     {
         return;
     }
     if (this._schema == null)
     {
         this.GenerateSchema();
     }
     if ((StatementType)3 == e.StatementType)
     {
         e.Command = this.CreateDeleteCommand();
     }
     else if ((StatementType)2 == e.StatementType)
     {
         e.Command = this.CreateUpdateCommand();
     }
     else if ((StatementType)1 == e.StatementType)
     {
         e.Command = this.CreateInsertCommand();
     }
     else if ((int)e.StatementType == 0)
     {
         return;
     }
     MySqlCommandBuilder.SetParameterValues(e.Command, e.Row);
 }
Exemplo n.º 4
0
        protected override void OnRowUpdating(RowUpdatingEventArgs value)
        {
            MySqlRowUpdatingEventArgs    mySqlRowUpdatingEventArgs    = value as MySqlRowUpdatingEventArgs;
            MySqlRowUpdatingEventHandler mySqlRowUpdatingEventHandler = (MySqlRowUpdatingEventHandler)base.Events[MySqlDataAdapter.EventRowUpdating];

            if (mySqlRowUpdatingEventHandler != null && mySqlRowUpdatingEventArgs != null)
            {
                mySqlRowUpdatingEventHandler(this, mySqlRowUpdatingEventArgs);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Overridden. Raises the RowUpdating event.
        /// </summary>
        /// <param name="value">A MySqlRowUpdatingEventArgs that contains the event data.</param>
        override protected void OnRowUpdating(RowUpdatingEventArgs value)
        {
            MySqlRowUpdatingEventArgs margs = (value as MySqlRowUpdatingEventArgs);
            //			if (args.StatementType == StatementType.Insert)
//				FixupStatementDefaults(args);

            MySqlRowUpdatingEventHandler handler = (MySqlRowUpdatingEventHandler)Events[EventRowUpdating];

            if ((null != handler) && (margs != null))
            {
                handler(this, margs);
            }
        }
 private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
 {
     base.RowUpdatingHandler(args);
 }
Exemplo n.º 7
0
 private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
 {
   base.RowUpdatingHandler(args);
 }
Exemplo n.º 8
0
        private void RowUpdating(object sender, MySqlRowUpdatingEventArgs args)
        {
            base.RowUpdatingHandler(args);

            if (args.StatementType != StatementType.Insert) return;

            if (ReturnGeneratedIdentifiers)
            {
                if (args.Command.UpdatedRowSource != UpdateRowSource.None)
                    throw new InvalidOperationException(
                        Resources.MixingUpdatedRowSource);
                args.Command.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
                if (finalSelect == null)
                    CreateFinalSelect();
            }

            if (finalSelect != null && finalSelect.Length > 0)
                args.Command.CommandText += finalSelect;
        }
Exemplo n.º 9
0
 void DataAdapter_RowUpdating( object sender, MySqlRowUpdatingEventArgs e )
 {
 }
Exemplo n.º 10
0
Arquivo: MySQL.cs Projeto: oeli/yafra
 /// <summary>
 /// Handles the RowUpdating event
 /// </summary>
 /// <param name="obj">The object that published the event</param>
 /// <param name="e">The OleDbRowUpdatingEventArgs</param>
 protected void RowUpdating(object obj, MySqlRowUpdatingEventArgs e)
 {
     base.RowUpdating(obj, e);
 }