Click here to Skip to main content
15,898,134 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 426.5K   22.2K   251  
Generates three tier code for ASP.NET.
<%
Function InterfaceProperty(PropertyName, ReturnType, CodeLanguage, Tab)
	Select Case CodeLanguage
		Case "0" 			
			InterfaceProperty = Tab & " Property " & PropertyName & "()" & GetReturnType(ReturnType) & vbCrLf 	 
		Case "1" 
			InterfaceProperty = Tab & ReturnType & " " & PropertyName & "{ get; set; }" & vbCrLf 	 
	End Select
End Function

Function GetValue(CodeLanguage)
	Select Case CodeLanguage
		Case "0" 			
			GetValue = "Value"
		Case "1" 
			GetValue = "value"
	End Select
End function

Function PropertyStart(AccessMod, PropertyName, ParametersCol, ReturnType, ImplementText, CodeLanguage, Tab)
	AccessMod = GetAccessModifier(AccessMod, "0", CodeLanguage)
	Select Case CodeLanguage
		Case "0" 			
			PropertyStart = Tab & AccessMod & " Property " & PropertyName & "(" & ParametersCol & ")" & GetReturnType(ReturnType) & " " & ImplementText
		Case "1" 
			PropertyStart = Tab & AccessMod & " " & ReturnType & " " & PropertyName 
	End Select
End Function

Function PropertyEnd(CodeLanguage, Tab)	
	Select Case CodeLanguage
		Case "0" 			
			PropertyEnd = Tab & "End Property" & vbCrLf 						
		Case "1" 
			PropertyEnd = Tab & "}" & vbCrLf  
	End Select
End function

Function GetStart(CodeLanguage, Tab)	
	Select Case CodeLanguage
		Case "0" 			
			GetStart = Tab & "Get" & vbCrLf 						
		Case "1" 
			GetStart = Tab & "get" & vbCrLf  
	End Select
End function

Function GetEnd(CodeLanguage, Tab)	
	Select Case CodeLanguage
		Case "0" 			
			GetEnd = Tab & "End Get" & vbCrLf 						
		Case "1" 
			GetEnd = Tab & "}" & vbCrLf  
	End Select
End function

Function SetStart(ReturnType, CodeLanguage, Tab)	
	Select Case CodeLanguage
		Case "0" 			
			SetStart = Tab & "Set(ByVal Value As " & ReturnType & ")" & vbCrLf 						
		Case "1" 
			SetStart = Tab & "set" & vbCrLf  
	End Select
End function

Function SetEnd(CodeLanguage, Tab)	
	Select Case CodeLanguage
		Case "0" 			
			SetEnd = Tab & "End Set" & vbCrLf 						
		Case "1" 
			SetEnd = Tab & "}" & vbCrLf  
	End Select
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