WebsiteDays.com create your web site free, Hosting, Coding, E-commerce, Free Website Builder. Download free website builder to create your website! Personal, and ECommerce website builders...

WebsiteDays.com for india alwar

Click on your region below to contact a Websitedays.com designer, or Websitedays.com sales person for info about Online Website builder system.

You can also send an email to

and we can forward your enquiry to respective designers in your area.

Agartala Agra Ahmedabad
Ahmednagar Aizawl Ajmer
Akola Alibag Aligarh
Allahabad Alleppey Almora
Alwar Ambala Amravati
Amritsar Amroha Anand
Anandpur-Sahib Ankleshwar Arpora
Aryankavu Aurangabad Auroville
Ayodhya Badlapur Balipara
Ballabgarh Bangalore Bareilly
Belgaum Bellary Bhangar
Bharatpur Bharuch Bhavnagar
Bhawanipatna Bhilai Bhopal
Bhubaneswar Bhuj-Rudramata Bicholim
Bijapur Bijnor Bikaner
Bodh Gaya Bokaro Steel City Brahmapur
Bundi Calicut Kozhikode Cannanore
Chandannagore Chandausi Chandigarh
Chandipur Changanacherry Chengannur
Chennai Madras Cherthala Chhatarpur
Chinsurah Chitradurga Chittoor
Cochin Kochi Coimbatore Cuddalore
Cuttack Darjiling Dehra Dun
Delhi Dewas Dhanbad
Dharamsala Dindigul Dungarpur
Durgapur Elamanchili Ernakulam
Erode Faridabad Gandhinagar
Gangtok Gauhati Ghaziabad
Gobindgarh Gorakhpur Greater Noida
Guntur Gurgaon Guruvayur
Gwalior Haridwar Hazaribag
Hisar Hosur Howrah
Hubli Hyderabad Igatpuri
Imphal Indore Itanagar
Jabalpur Jaipur Jaisalmer
Jalandhar Jamnagar Jamshedpur
Jodhpur Kakinada Kaladi
Kalimpong Kalpetta Kalyan
Kanchipuram Kannur Kanpur
Kanyakumari Kapadvanj Karauli
Karnal Karur Karwar
Kashmir Kassar Kausani
Khajuraho Kharagpur Kishangarh
Kodaikanal Kolhapur Kolkata Calcutta
Kollam Komarapalayam Kootanad
Kota Kothamangalam Kottakkal
Kottayam Kovilpatti Kullu
Kumaon Kumbakonam Kumta
Lonavala Lovedale Lucknow
Ludhiana Madurai Mahe
Mamallapuram Mahabalipuram Manali Mangalore
Manjeri Mardol Margao
Matheran Mathura Meerut
Moradabad Morbi Mumbai Bombay
Munnar Mussoorie Mysore
Nabha Nadiad Nagaur
Nagpur Nainital Narendranagar
Nasik Navsari Nawalgarh
Nellore Noida Ooty
Panaji Panchgani Panchkula
Panipat Panvel Patiala
Patna Pattambi Perumbavoor
Phagwara Pilani Ponda
Porbandar Pune Puri
Pushkar Raipur Rajapalayam
Rajkot Rajpipla Ramanathapuram
Ranchi Ratnagiri Rishikesh
Roorkee Saharanpur Salem
Sanawar Sangli Satara
Satna Sawai Madhopur Secunderabad
Shillong Shimla Sidhi
Sirsa Sivakasi Solan
Solapur Sonepat Srinagar
Sullia Surat Surendranagar
Tezpur Thalassery Tellicherry Thane
Thanjavur Thekkadi Thiruvalla
Thiruvananthapuram Trivandrum Thrissur Tiruchirappalli
Tirumala Tirunelveli Tirupati
Tiruppur Tirur Trichur
Tumkur Tuticorin Udaipur
Udupi Ulhasnagar Vadodara
Valsad Varanasi Vellore
Vijayawada Virudunagar Visakhapatnam
Vrindavan Warangal Yamunanagar
Yercaud

»   Custom Hooks in TierDeveloper

Article submitted in category: Web Design And Development
Tags: | | | hooks | public | custom | code | custom hooks | database | objinfo | own | int | // | // | tier

Custom Hooks in TierDeveloper by: Ann Morris

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;

}

}

About The Author

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

ann@alachisoft.com

This article was posted on January 07, 2005