This tool generates Angular Type Script code and Web Api scripts(CURD operations) for the given MsSql tables.
DB SETUP
-
Create a new database in MsSql and copy the following Table Scripts and execute them.
CREATE TABLE [dbo].[Departments]
(
[Id] BIGINT NOT NULL PRIMARY KEY,
[Name] VARCHAR(50) NULL
);
CREATE TABLE [dbo].[Categories] (
[Id] INT NOT NULL PRIMARY KEY,
[Name] NVARCHAR (50) NOT NULL,
[Description] NVARCHAR (50) NULL
);
CREATE TABLE [dbo].[Products] (
[Id] BIGINT NOT NULL PRIMARY KEY,
[Name] VARCHAR (50) NOT NULL,
[CategoryId] BIGINT NULL,
[ShortDesc] VARCHAR (50) NULL,
[LongDesc] VARCHAR (200) NOT NULL,
[StartDate] DATETIME NULL,
[EndDate] DATETIME NULL,
[IsActive] BIT NULL,
[Price] MONEY NULL,
[Quantity] INT NULL,
[EmailAddress] VARCHAR (50) NULL,
[WebAddress] VARCHAR (200) NOT NULL
);
-
Theree tables will be created.
-
Select the Table Name "Products" from the ComboBox
-
Click on "Add New Tab"
-
Give the Tab Name as "Product Details".
-
And repeat the process and give the Tab Name as "Seller Details".

-
Click on "Add New Service Looup" and in the popup give the Static Lookup Name as "ActiveLookUp".
-
Select the "ActiveLookUp" from the list box.
-
Click on "Add New LookUp" Button.
-
Give the Key as "Active" and Value as "1".
-
And click on "Add New LookUp" Button.and give the Key as "InActive" and Value as "0".


-
Click on "Add New LookUp Service" button.
-
Give the Name as CategoriesLookUpService in the Look Up Name.


-
Select the Table as Categories.
-
Key as Id
-
and Value as Name.
-
After completing all the steps, Click on "Generate Code".
-
It checks for validations ( A primary key for each Table). If it passes will display the Success for Validation.
-
Will post the data to the server, the code generation takes place at the server and a Download Link is provided as shown below.

-
The downloaded zip file will contain the following structure.
-
Angular : contains the Typescript code.
-
WebApi contains the webapi project.
-
Db.Sql contains the required Stored procedures.
-
The Readme text file contains the instructions to follow.

-
Open the Dd.Sql file from the downloaded zip file. And execute the SPs in the Database using the query window.
-
Open the WebApi Solution (\WebApi\WebApi\WebApplication1) in the visual studio 2015 or above.
-
Open the Package Manager Console from Tools->Nuget Pacakage Manager-> Package Manager Console

-
Run the following command to update the required nuget packages.
-
Update-Package Microsoft.AspNet.WebApi -reinstall

-
In the web.config file you can change the database connection string if needed by changing myConnectionString

-
Open the project in Visual studio code by pointing to Angular\Theame folder.
-
Open the Integrated terminal from View->Integrated Terminal.
-

-
Run the following command to install required the ngModules. Will install all the required packages.
-
npm install --save-dev @angular-devkit/build-angular
-
will install all the required NgModules.

-
Open the file AppConstants from src->app->view-> AppConstants.ts.

-
Change the base url path to point to your hosted url. http://localhost:4200/api to your url.

-
In the Integrated Terminal Use ng serve –open to run the project.