Baadal Tutorials - Document
In the previous Section, you have already created a new Baadal Project. In this Section, you will learn how you can add functionality to the Project by adding Forms and Menus.
How to create Forms in Baadal Application?
First, let us create Forms.
When you create a Project, Baadal will automatically create all the default forms.
Let us see how to Create New Forms which are specific to your Project.
Click on "New Form" - A window opens, where you will be able to select the type of form that you want. Baadal offers many types of Forms which find applications depending upon the varying business requirements.
Select "Table-Detail Entry".
Select the "Salutation" table and Select "Salutation" as the Primary Key Field and Click on " Create" Button. A New Form will be created with all the required buttons such as "New", "Save", "Delete", "Search" & " Export". All of them will have predefined actions. You can delete them if you don't need them, or change their properties if required.
Similarly, you can Create "Relationship" Form and " Contact Editor" Forms.
In Salutation and Relationship Forms, not many things are to be changed. But in the "Contact Editor" form you should make some changes. Since "Salutation" and "Relationship" should be selected from the master tables, you have to change the text box to Dropdown Control.
To change Textbox to Drop-down, select the input control type in properties grid and Change it to drop down. Once the dropdown control is created, you can assign LINQ SQL Query in properties, to fetch records from Salutation Table as shown in the example.
Similarly, you can change Category as a Dropdown.
Now you have completed designing the Forms.
Next, click on Form Code to generate the code of the particular form.
Click on the Generate button. It will populate the Controller, Model, Service and View Code in the respective tabs.
Now you can Design the menu items.
How to create menus in Baadal Application?
You will require only 3 Menu Items in this application.
- Contact Editor
Let us select "Menu Definition" Icon from the Ribbon.
Click on 'Add Root Menu' a New Menu will be created. Now click on the 'Rename' button and call that menu as 'Main'.
Right Click on "Main" Menu and then Click on " Add Sub Menu" and Create the 3 required Sub Menus - Salutation, Relationship, and Contact Editor. Now since you have not yet designed Forms, you will not be able to assign any functionality to menus.
Using arrow buttons provided on the right side of the Menu designer, it is possible to move the menu items up and down and also change the Menu Level.
As you change the menu Items, Menu gets changed in this window. You can get a preview of your menu design in the same window.
You can now assign Forms to Menus.
How to assign Forms to Menus in Baadal Application?
Come back to Menu Definition Screen. Select 'Salutation' and Right Click and click on "Associate Form". Click on Application Forms button, and in the window that opens, click the "Generate Automatically" button. This is a one-time procedure, whenever a new form is created.
Here, all forms created will now be generated. Close the window, and in the List of Forms window, click on the Form which you want to associate, and click the associate button. Here, associate the Salutation Form.
Create the desired roles based on your requirements, from the "Add New
Define the role name, Landing controller name, and the page name.
Assign the role name to the selected menu. Only the users with these defined roles will have access to the selected form. Also, you can set multiple roles to the form.
In the same way, you can associate other forms to menus items.
Now you are ready to build the application.
In the next Section, you will learn to generate the Application in Baadal.