private void OnRowUpdating(object sender, OdbcRowUpdatingEventArgs 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;
            }
        }
 private void OdbcRowUpdatingHandler(object sender, OdbcRowUpdatingEventArgs ruevent)
 {
     RowUpdatingHandler(ruevent);
 }
 private void OdbcRowUpdatingHandler(object sender, OdbcRowUpdatingEventArgs ruevent) {
     RowUpdatingHandler(ruevent);
 }
Exemple #4
0
		private void OnRowUpdating (object sender, OdbcRowUpdatingEventArgs 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;
			}
		}
Exemple #5
0
 /// <summary>
 /// Handles the RowUpdating event
 /// </summary>
 /// <param name="obj">The object that published the event</param>
 /// <param name="e">The OdbcRowUpdatingEventArgs</param>
 protected void RowUpdating(object obj, OdbcRowUpdatingEventArgs e)
 {
     base.RowUpdating(obj, e);
 }
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// odbcrowupdatingeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this OdbcRowUpdatingEventHandler odbcrowupdatingeventhandler, Object sender, OdbcRowUpdatingEventArgs e, AsyncCallback callback)
        {
            if(odbcrowupdatingeventhandler == null) throw new ArgumentNullException("odbcrowupdatingeventhandler");

            return odbcrowupdatingeventhandler.BeginInvoke(sender, e, callback, null);
        }