Submit Free Article

Google
Web www.httparticles.com


httparticles.com serves you free to republish and reprint articles from authors around the net.
Partners
 

Latest Article Added

 
Forex Indicators to Watch
Last Minute Presents
Best views Beaucoup de nouveau et inattendu. Simplement parfaitementowlj --05
What to do when a dent appears on your car.
The Shot Heard Around the World: Google's Endorsement of "Get Google Ads Free"
You rock man Montante gradevole al palatofnlt O_O62
The Truth About Golf and the Zone
3 Tips To Learn Spanish Quickly
Baby Shower Favors for Boys or Girls and Even Twins Made Easy
If it is not BuyATimeshare.com, Buyer Beware
10 Organizing Tips To Reduce Stress During The Holidays
All About Christmas Cards--7 Organizing Tips
13 organizing tips for car safety for the holidays
Halloween Party
I answer you Travail spectaculairesqcn :)))50
What do you know about teenagers and marijuana?
Foundation Repair
Toyota Body Kits¡ªDrive the Coolest Car in Town
Learn Spanish And Boost Your Earning Potential
Sleep Your Best With an Electric Bed.
How to Determine the Value of a Fine Rug
Discount Cruises and Group Travel
Home Transcription Jobs: The Best Career Option
This is awesome Beautiful sitertsq -27
Even if you wanna buy a cheap car, you still can get a luxury model
Forex Trading Market, Should You Invest
Panic Attack While Sleeping
Cute Snowbuddies Figurines & Ornaments
GIFT BASKET IDEAS FOR A NEW NEIGHBOR
Used unlocked Cell Phones
Featured Articles
Real Estate Contract Basics

The real estate contract is the most often used, yet little understood tool in the real estate business. Whether you are a rank beginner or seasoned expert, there is no excuse for not knowing and understanding the real estate contract Read on...

Understanding the mortgage market

The mortgage business is a complicated and ever-changing industry. It is important that you understand how the mortgage market works and how the lenders make their profit Read on...

Computers :: Custom Hooks in TierDeveloper
Custom Hooks is another powerful and most demanding feature provided by TierDeveloper. Custom Hooks work like database triggers. It could be your own business logic that you can activate before or after performing some database action(s). PreHooks and PostHooks are two ways, provided by TierDeveloper, through which you can embed your own logic in the generated code. Pre hook methods are called before the database access is performed whereas post hook methods are called after the database operations are performed.

Custom hooks can be specified wherever database access is performed. It includes standard operations, query methods, bulk operations and custom operations. User can generate skeleton code for custom hooks of the selected methods or he/she can use his/her own hooks class.

For your convenience and better understanding I have listed sample code here which shows how TierDeveloper embed custom hooks in the generated code. It is pretty self-explanatory.

public void UpdateCustomerInfo(Customers objInfo)
{
try
{
... ... .... .......
... ... .... .......

CustomersHooks hooks = new CustomersHooks()
status = hooks.PreUpdateCustomerInfo((System.Data.SqlClient.SqlConnection)getConnection(), objInfo)

if (status != CustomersHooks.SUCCESS_CONTINUE)
{
SetStatus(status == CustomersHooks.FAIL_NONCONTINUE ? EStatus.eFail : EStatus.eSuccess)
ReleaseCommand()
return
}

AddCmdParameter("@CompanyName", TDevFramework.EDataType.eVarchar, objInfo.CompanyName, TDevFramework.EParamDirection.eInput, objInfo.IsNull("CompanyName"))
... ... .... .......
... ... .... .......
... ... .... .......

ExecuteNonQuery()

status = hooks.PostUpdateCustomerInfo((System.Data.SqlClient.SqlConnection)getConnection(), objInfo)

if (status != CustomersHooks.SUCCESS_CONTINUE)
{
... ... .... .......
... ... .... .......
return
}

SetStatus(EStatus.eSuccess)
ReleaseCommand()
}
catch (Exception e)
{
... ... .... .......
... ... .... .......
throw e
}
}

public class CustomersHooks
{
public const int SUCCESS_CONTINUE = 0
public const int SUCCESS_NONCONTINUE = 1
public const int FAIL_NONCONTINUE = 2

public int PreUpdateCustomerInfo( System.Data.SqlClient.SqlConnection Conn, Customers objInfo)
{
//.. .. .. . .. ..
// . .. .. .. .. Put your own code here
return SUCCESS_CONTINUE
}

public int PostUpdateCustomerInfo( System.Data.SqlClient.SqlConnection Conn, Customers objInfo)
{
// .. .. .. .. . .. .. ..
// .. .. .. .. put your own code here.
return SUCCESS_CONTINUE
}
}

Author Info:

Ann Morris - I work in a software development Organization and interested in writing technical articles. ann@alachisoft.com

News Feeds
The purchase of recreational vehicles should not be done on a whim.
The purchase of recreational vehicles should not be done on a whim.

How to Choose a Trade Data Provider
How to Choose a Trade Data Provider

Celica Marketing
Celica Marketing

Lean Six Sigma Consultancy: The Ultimate destiny in your quest for flawless Quality!!
Lean Six Sigma Consultancy: The Ultimate destiny in your quest for flawless Quality!!

Throw Your Special Event with Help of Event Planning Companies
Throw Your Special Event with Help of Event Planning Companies

Labeled articles for your Adsense Site!
Labeled articles for your Adsense Site!

10 Ways to Cut Costs Without Having to Cut People From Your Payroll
10 Ways to Cut Costs Without Having to Cut People From Your Payroll

Management: 6 Essentials of Managing People
Management: 6 Essentials of Managing People

How Gantt Charts Can Help Avoid Disaster
How Gantt Charts Can Help Avoid Disaster

Management: 5 Reasons Why You Must Manage Others Effectively
Management: 5 Reasons Why You Must Manage Others Effectively


Make Your Own Website


Copyright © httparticles.com  2005. All Rights Reserved.