Version

Update Method (WebScheduleDbProvider)

Updates WebSchedule objects to the data model using the configured data bindings and underlying data store technology.
Syntax
'Declaration
 
Public Overridable Sub Update( _
   ByVal context As DataContext _
) 
public virtual void Update( 
   DataContext context
)

Parameters

context
A DataContext describing the data bindings and operation to be performed.
Exceptions
ExceptionDescription
System.ArgumentExceptionThrown when context is not a supported DataContext class or subclass. context must be UpdateRemindersContext, UpdateActivityContext, AddActivityContext, RemoveActivityContext, UpdateResourceContext, AddResourceContext, RemoveResourceContext, or UpdateSnoozeContext.
System.ArgumentNullExceptionThrown when the supplied context is null (Nothing in Visual Basic .NET).
Remarks

This method implements the Update method of the IDataUpdate interface. The WebScheduleInfo consumes this interface in order to persist changes to Activities and Resources from the WebSchedule data model during postback changes and events.

Web application developers should not call this method directly from their scheduling applications. Instead, they may call the public methods exposed by the WebScheduleDbProvider for adding, editing, and deleting instances of Activities and Resources from the data store.

The base class implementation of Update handles the following operations:

  1. Inserts an individual activity, optionally associated with an organizing resource who owns it.
  2. Updates an existing activity for edits performed by an end user.
  3. Deletes an existing activity in reaction to an end user request.
  4. Inserts an individual resource. Not currently used during interactive processing, but supports the AddResource method for administering the WebSchedule data model.
  5. Updates an existing resource for changes. Not currently used during interactive processing, but supports the UpdateResource method for administering the WebSchedule data model.
  6. Deletes an existing resource. Not currently used during interactive processing, but supports the RemoveResource method for administering the WebSchedule data model.

Inheritors developing their own custom data provider should override Update to support additional operations, current operations on different relational database management systems, and data bindings (e.g., to increase the number of types the WebSchedule data model can persist from a scheduling application). Please see the help documentation for further information on extending WebScheduleDbProvider to create a custom data provider.

When extending the WebScheduleDbProvider (additional operations or data bindings), inheritors should first check context to see if it matches one of their extended DataContexts. When it does, the subclass is responsible for dispatching it to a method it implements for handling that operation and/or ScheduleDataBinding subclass. If the context does not match a recognized operation, then call the base implementation of Update to ensure proper dispatch and/or error handling.

When implementing support for a new relational database management system (or other underlying data store), the implementation of methods for standard operations (i.e., "FetchActivities", "AddActivity", etc.) MAY not be compatible with that data technology. When this is the case, the overridden implementation of Fetch in the subclass should handle the standard operation and dispatch it to it's own method supporting the new data platform.

AddActivityUpdateActivityRemoveActivityAddResourceUpdateResourceRemoveResource
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also