SIGN UP MEMBER LOGIN:    
ARTICLE

N-Tier Code Generator for ASP.NET

Posted by Nesreen Maged Articles | ASP.NET Programming May 20, 2009
This application helps developers to build an N-Tier Web application and saves development time and effort.
Reader Level:
Download Files:
 

Introduction

The attached application helps developers to save time and effort in creating N-tier applications.

It creates stored procedures, adds data, data access layer, business layer and web pages in ASP.NET version and all layers works with C# and data, data access layer, business layer with c# and vb.net.

The system has code template for each layer then according to the selected language it create properties and events and methods then find the properties region or method region and replace the region in templates with the code then save it as files for selected layer

How to Use Steps:

  1. Set Connection, output folder and language settings
    Select C# as a language;
    check Use Data Object so the methods take one object as parameter (its recommendation to set primary key name table name + "Id"

  2. Click Get Tables to retrieve all tables schema

  3. Go to Generate stored procedure tab and click generate In this step the application will get saved stored procedure template then loop on database tables and get table name then replace #Table Name# with the table name in the template and save it as sql file

  4. Go to Generate data objects tab and click generate in this step the application get the data object template for selected language and put fields and variables according to the selected language Vb or C#

  5. Go to Generate data access layer tab and click generate the same as the previous step but it read from DAL Template according to the selected language and create method parameters and return types then create the new DAL Class for each table in selected database

  6. Go to Generate business layer tab and click generate using the bus template

  7. Go to Generate web layer (GUI) tab and click generate in this step the application generate master page ,base web form and for each table it generate details page and list


---- page the details page contain textbox ,required validation ,save and delete button the detail page works in two modes (Insert new item and update exists data)

---- list page contain the list of all data in the table in data grid view and edit link in each row to open detail page in edit mode

The DB Manager Class

Used to get tables and columns schema and required columns and primary keys and foreign keys

The File Manager

Used to manage templates and layers files to create files from templates and save it in selected output folder 

image1.gif


Download and run the attached application for more details.

 


Login to add your contents and source code to this article
Article Extensions
Contents added by Nesreen Maged on Jul 02, 2009
Download File: TestCodeGenerator.zip

Simple NTier project using code generator 

note: attach the TestGenerator.mdf and change connection string in web config

Contents added by Nesreen Maged on May 21, 2009
Download File: CodeGenerator2005.zip
Contents added by uri b on May 21, 2009

hi , very nice application , and very productive , but a lot of files are missing in the solution.

i can run or compile the code to test it .

please upload a new one that can be tested.

thxmissing.JPG

share this article :
post comment
 

I am getting conversion error .

Error : Unable to parse project file codeGenerator2005.csproj
I can not see project because of non-conversion

Posted by sudhir Belani Feb 04, 2010

Thanks, Nesreen.

I appreciate your quick response.

--Doug

Posted by Doug Jul 02, 2009

Hello orillia319

Thank you for your comment
-the base class (BaseDL ,IDL) are  just empty classes and empty interface
you can add it manual  or remove it from parent class text box so it will generate the classes without parent.
-remove using utilities (it's mistake)
-I uploaded  a Simple Ntier project 
 using the Generator with db .just attach the db and change connection string in web config

Thanks & Best Regards
Nesreeen

Posted by Nesreen Maged Jul 02, 2009

Hello Nesreen,

Would you be able to provide an example of a generated application using a simple database? I creating an empty .NET project in Visual Studio and copied the contents of the top-most generated folder to the new project. Unfortunately, I encountered a few compile errors. For example:

public class personDL : BaseDL,IDL
-> "The type or namespace name 'BaseDL' could not be found..."

Is it possible that BaseDL.cs is missing...? (same with IDL, Utilities, BaseBL, IBL)

Many thanks for all the hard work you've put into your code generator!

Regards,
--Doug

Posted by Doug Jun 30, 2009

:)

Posted by Nesreen Maged Jun 06, 2009
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor