9using System.Collections.Generic;
12using System.Data.SqlClient;
13using System.Configuration;
20 #region "Business methods"
29 private set { LoadProperty(
IDProperty, value); }
62 #region "Factory Methods"
84 private class Criteria
88 public Criteria(
int id)
104 BusinessRules.CheckRules();
105 Console.WriteLine(
"DataPortal_Create");
110 Console.WriteLine(
"DataPortal_Fetch");
113 BusinessRules.CheckRules();
128 SqlCommand cm1 =
new SqlCommand();
130 cm1.CommandText =
"INSERT INTO Table2(FirstName, LastName, SmallColumn) VALUES('Bill', 'Thompson', 'abc')";
135 SqlCommand cm2 =
new SqlCommand();
138 cm2.CommandText =
"INSERT INTO Table2(FirstName, LastName, SmallColumn) VALUES('";
139 cm2.CommandText += firstName;
140 cm2.CommandText +=
"', '" + lastName +
"', '" + smallColumn +
"')";
143 cm1.ExecuteNonQuery();
144 cm2.ExecuteNonQuery();
149 Console.WriteLine(
"DataPortal_Insert");
156 Console.WriteLine(
"DataPortal_Update");
164 Console.WriteLine(
"DataPortal_DeleteSelf");
172 Console.WriteLine(
"DataPortal_Delete");
Provides consistent context information between the client and server DataPortal objects.
void Clear()
Clears all context collections.
This is the base class from which most business objects will be derived.
Client side data portal used for making asynchronous data portal calls in .NET.
void Delete(params object[] criteria)
Called by a factory method in a business class or by the UI to delete an object.
T Create(params object[] criteria)
Called by a factory method in a business class to create a new object, which is loaded with default v...
T Fetch(params object[] criteria)
Called by a factory method in a business class to Fetch a new object, which is loaded with default va...
Maintains metadata about a property.
void DataPortal_DeleteSelf()
void DataPortal_Fetch(object criteria)
static void DeleteESTransactionalRoot(int ID)
static ESTransactionalRoot GetESTransactionalRoot(int ID)
void DataPortal_Delete(object criteria)
override void AddBusinessRules()
static PropertyInfo< string > LastNameProperty
static PropertyInfo< string > FirstNameProperty
static ESTransactionalRoot NewESTransactionalRoot()
static PropertyInfo< string > SmallColumnProperty
static string CONNECTION_STRING
static PropertyInfo< int > IDProperty
static string DataPortalTestDatabase
TransactionalTypes
Provides a list of possible transactional technologies to be used by the server-side DataPortal.
@ Serializable
Prevents updating or inserting until the transaction is complete.
@ Update
Update operation (includes insert, update and delete self).
@ Create
Create operation.
@ Delete
Delete operation.