Exemple #1
0
        private void RowUpdatingHandler(object sender, FbRowUpdatingEventArgs e)
        {
            if (e.Status != UpdateStatus.Continue)
            {
                return;
            }

            if (e.Command != null)
            {
                // Check that we can really	build a	new	command.
                // If the command passed in	the	FbRowUpdatingEventArgs
                // is different	than the one existent in the CommabdBuilder
                // we can't	build a	new	command

                FbCommand command = null;

                switch (e.StatementType)
                {
                case StatementType.Insert:
                    command = this.insertCommand;
                    break;

                case StatementType.Delete:
                    command = this.deleteCommand;
                    break;

                case StatementType.Update:
                    command = this.updateCommand;
                    break;
                }

                if (command != e.Command)
                {
                    return;
                }
            }

            try
            {
                switch (e.StatementType)
                {
                case StatementType.Insert:
                    e.Command = this.BuildInsertCommand(
                        e.Row,
                        e.TableMapping);
                    break;

                case StatementType.Update:
                    e.Command = this.BuildUpdateCommand(
                        e.Row,
                        e.TableMapping);
                    break;

                case StatementType.Delete:
                    e.Command = this.BuildDeleteCommand(
                        e.Row,
                        e.TableMapping);
                    break;
                }
            }
            catch (Exception exception)
            {
                e.Errors = exception;
                e.Status = UpdateStatus.ErrorsOccurred;
            }
        }
		private void RowUpdatingHandler(object sender, FbRowUpdatingEventArgs e)
		{
			if (e.Status != UpdateStatus.Continue)
			{
				return;
			}

			if (e.Command != null)
			{
				// Check that we can really	build a	new	command.
				// If the command passed in	the	FbRowUpdatingEventArgs
				// is different	than the one existent in the CommabdBuilder
				// we can't	build a	new	command

				FbCommand command = null;

				switch (e.StatementType)
				{
					case StatementType.Insert:
						command = this.insertCommand;
						break;

					case StatementType.Delete:
						command = this.deleteCommand;
						break;

					case StatementType.Update:
						command = this.updateCommand;
						break;
				}

				if (command != e.Command)
				{
					return;
				}
			}

			try
			{
				switch (e.StatementType)
				{
					case StatementType.Insert:
						e.Command = this.BuildInsertCommand(
								e.Row,
								e.TableMapping);
						break;

					case StatementType.Update:
						e.Command = this.BuildUpdateCommand(
								e.Row,
								e.TableMapping);
						break;

					case StatementType.Delete:
						e.Command = this.BuildDeleteCommand(
								e.Row,
								e.TableMapping);
						break;
				}
			}
			catch (Exception exception)
			{
				e.Errors = exception;
				e.Status = UpdateStatus.ErrorsOccurred;
			}
		}
Exemple #3
0
		/// <summary>
		/// Handles the RowUpdating event
		/// </summary>
		/// <param name="obj">The object that published the event</param>
		/// <param name="e">The FbRowUpdatingEventArgs</param>
		protected void RowUpdating(object obj, FbRowUpdatingEventArgs e)
		{
			base.RowUpdating(obj, e);
		}