Click here to Skip to main content
15,881,092 members
Articles / Web Development / ASP.NET

Three Tier Code Generator For ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.78/5 (34 votes)
8 Jul 200512 min read 425K   22.2K   251  
Generates three tier code for ASP.NET.
<%
Function StartObjInterface(Tab)
	StartObjInterface = CommentType("Interface: I" & ObjectName, "Description: Interface to define the properties of the business object to be used by the databse object," & Tab & "of the " & TableName & "." , vbTab ) &_ 
	InterfaceStart("Public", "I" & ObjectName, CodingLanguage, Tab) &_
	OpenScope(CodingLanguage, Tab)	
End Function

Function DefineObjInterface(Tab)
	
	DefineObjInterface  =	StartObjInterface(Tab) &_	
				DefineInterfaceProperty(FieldId, "Int32", Tab & vbTab) 
			
	FOR NumLoop = 0 to FieldCount
		DefineObjInterface = DefineObjInterface & DefineInterfaceProperty(AllFieldsNames(NumLoop), TypeNetFieldsNames(NumLoop), Tab & vbTab) 	 
	NEXT

	DefineObjInterface = DefineObjInterface & InterfaceEnd(CodingLanguage, Tab) & vbCrLf
End Function

Function DefineInterfaceProperty( PropertyName, PropertyType, Tab)
	DefineInterfaceProperty = DefineInterfaceProperty & InterfaceProperty(PropertyName, PropertyType, CodingLanguage, Tab)					
End Function

Function ObjInterface()
	ObjInterface = PageComments("I" & ObjectName & GetFileExtension(CodingLanguage), AuthorCompany, "") &_
		ImportsUsing("System", "" ) &_
		StartNameSpaceBlock(InterfaceNamespace(), "") &_
		DefineObjInterface(vbTab) &_
		EndNameSpaceBlock()
End Function
%>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Australia Australia
Stevan is a Microsoft Certified Solutions Developer in .Net Architecture (MCSD.Net Early Achiever – one among the first 2500 worldwide), Microsoft Certified Application Developer in .Net – MCAD.Net (Charter Member - one among the first 5000 developers worldwide).

Comments and Discussions