Reader Level:
ARTICLE

N-Tier Code Generator for ASP.NET

On May 20, 2009 Articles | ASP.NET Programming
This application helps developers to build an N-Tier Web application and saves development time and effort.
  • 1
  • 0
  • 25042
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.

 


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

  • 504rank
  • 47K readers
COMMENT USING

Trending up