AppGauge AppGauge
Step 0
Know AppGauge Basics
AppGauge, in simple terms, is a framework for developing complex ASP.NET web projects in very short time with very ease. On the surface, AppGauge is very very simple, very easy to use and very robust and secure.

In this tutorial, we will creat a new Database-driven application and see how AppGauge minimizes rudimentary tasks. We are going to create a small book storage management system for a publisher. For the sake of simplicity, lets assume the following fields:
  • Book Name
  • Book Price
The inventory must be able to add new books as well as Delete and Update existing books.
Step 1
Arrange all pre-requisites.
In order to proceed with application development using AppGauge, you must have the following already installed on your system:
  1. AppGauge : To start the development, you must have the AppGauge dll file with you. If not, download it from here.
  2. AppGauge AppData CodeGenerator : The CodeGenerator is a simple tool to generate Business Objects on the fly and make your development more faster.
  3. Visual Studio : You can use any version of Visual studio that supports .net version 2.0 and up. Collect the latest version here.
  4. SQL Server : AppGauge is designed to work with most of the version of SQL Server. We recommend you to first work with an express edition. Collect the latest version here.
  5. Extra : These resources are not mandatory however we recomend yo use these to speed up devellopment:
    • SQL Management Studio. Collect it here.
    • AJAX Control Toolkit. Collect it here.

If you have successfully acquired all the above then you are ready to go to the nest step.
Step 2 Create a Database.
First, we organize the fields of the table 'tblBook' :

Field Data Type
bookId int( auto increment, primary key)
bookName varchar(50)
bookPrice number(400,2)


Script:
CREATE TABLE tblBook( bookId int IDENTITY(1,1) NOT NULL primary key, bookName varchar(50) NOT NULL, bookPrice numeric(4, 2) NULL);
Now, lets assume the following database connection details:

Database Sever: Bhavitra/sqlexpress
Database Name: AppGauge
User ID: sa
Password: adminpass
Step 3 Create an ASP.NET Application.

After creating the table, lets create a new ASP.NET Application. Go to File > New Website.

Make sure you create an empty website. If you have other .aspx files, delete them and make sure you have only one .aspx file i.e. Default.aspx.

Now, link the appgauge.dll file by right clicking on the References Folder in the Solution Explorer and browsing the dll file.

Step 4 Design Agents.
With the invent of Fluent API 'AppData' creating AppGauge Apps is very simple. Load the CodeGenerator Tool. Input the connectionString and hit Connect. Business Objects willbe created dynamically out of all the tables in that database.

By default, all the Business Objects will be places in "C:\AppData_Objects\"
Design the form with text boxes and gird view accordingly.Something Like :
AppGauge Design Page
Business Objects will have the same filename and class name as Table Name. In this case, itstblBook.cs :
using AppGauge.Data.SqlServer.Fluent;

[Table("tblBook")]
class tblBook : AppData
{
	[Column("bookId",true)]
	public int bookId {get; set;}

	[Column("bookName")]
	public string bookName {get; set;}

	[Column("bookPrice")]
	public double bookPrice {get; set;}

	public tblBook()
	:base(@"Data Source=Bhavitra\sqlexpress;Initial Catalog=AppGauge;User ID=sa;Password=admin")
	{
	}
}


Now, In your Default.aspx.cs code, just create an object of book and you are ready to manipulate the Book.
Creating an object of Book table
tblBook bk = new tblBook();
Adding new Book
bk.bookName="Abar arekbar anekbar";
bk.bookPrice = 50.3;
bk.Save();
Viewing a Book
bk.View(bk.bookId);
TextBox1.Text=bk.bookName;
Editing a Book
bk.bookId(101);
bk.bookName="Bar Bar protibar";
bk.bookPrice = 50.3;
bk.Save();
Deleting a Book
bk.Delete();
As easy as that!
Step 5 Debug and Execute.
Do NOT forget to change the database connection details before firing up this demo. All the credentials is supposed to work with my local pc only.