Read Catalogue
- Brief introduction
- System Features
- System Introduction-Home
- System Introduction-List Page
- System Introduction-Detail page (form)
- System Introduction-Menu/button
- System Introduction-Permission Center
- System Introduction-Data permissions
- System Introduction-Field permissions
- System Introduction-drop-down box application details
- Conclusion
Brief introduction
LIGERRM V2 is a Web application system based on Ligerui. With authority management as a design focus, Northwind was introduced as the main data presentation module. Permission, the Data permission control is added on the basis of the previous version. The background aspect uses DOT NET 3.5 framework development.
- System Demo: http://case.ligerui.com
- Front-Office plugins: JQuery, Jquery.ligerui, JQuery.form.js, jquery.validation
- Data interaction: Liger. Data (a small ORM component)
- SOURCE Download: ligerRMV2
Demo Account:
| Account |
Name |
Title |
Password |
| Test3 |
Entry Clerk 1 |
Basic Data Entry Clerk 1 |
1 |
| Test2 |
Entry Clerk 2 |
Customer Data Entry Clerk 2 |
1 |
| Test1 |
Advanced Demo Account 1 |
Advanced Demo Account 1 |
1 |
| Test4 |
Order Viewer 1 |
Order Viewer 1-sales Representative |
1 |
| Test5 |
Suppliers 1 |
Suppliers 1-exotic Liquids44 |
1 |
System Features
1, does not adopt the Code-behind mechanism, does not use any server control, completely puts the work in the foreground realization, the backstage only processes the data part. The page or ASPX suffix inherits from the Unified page base class (for easy control of permissions).
2, greatly avoiding code redundancy. Whether it is a list page or a detail page, you see the code is extremely concise, even if it is a form, and even do not need any HTML code, but rather the definition of "useful information", "Layout", "Data" useful "structure", of course, the table, the search box is the case.
3, unified data submission/receiving interface, all data requests through AJAX implementation, after HANDLER/*.ASHX processing, for the foreground data request type of different, a total of 6:
AJAX.ASHX----Common Data request entry (form submission portal, form loading portal, common data loading portals, etc.)
GRID.ASHX----Universal Ligergrid table Data Loading Portal
TREEGRID.ASHX----Common Ligergrid table tree format data Loading portal
TREE.ASHX----Common Ligertree tree format data loading portal
SELECT.ASHX----General-purpose Ligercombobox data loading portal
VALIDATE.ASHX----Universal Verification Data Validation portal (for jquery.validation Remote authentication)
4, improve the data rights control mechanism. In addition to the basic (User role) and (module function) of this kind of functional permission control, but also at the data request entry did a little action, according to "Current user information" and "configured data permission rules" filter data filtering.
5, automatic search box, automatic form. Forms and search boxes no longer require a bunch of complex, redundant HTML, but rather the information (field name, width, type, and so on) that defines the field can be used to automate the construction of the page.
6, automatic table, the same table also just need some configuration information, it can be done automatically. And the use of filter plug-ins, with advanced custom query function, and historical query function.
System Introduction-Homepage with permission control module
When you load the home page, the system loads the permission's menu module according to the user's information:
System Introduction-List page (Configured search box, table, dynamic button (permission control))
The search box, table is no longer a bunch of HTML to spell out, but only defined with "layout" and "Data" configuration information.
The action button is based on the permissions control of the current page and loads the action button with permission.
The specific practice is to judge the page's Menuno (menu unique encoding), according to the Menuno and the current user Information Load Permission permission button, Menuno get rule:
Priority one: If the page defines a hidden field with id "Menuno", then read the value of this hidden field, such as: <ipnut type= "hidden" id= "Menuno" value= "Ordermanageorders"/>
Priority two: The value of Menuno based on the querystring,name of the page URL
Priority three: Match according to the URL of the page,/ordermanage/orders.aspx,menuno is ordermanageorders
Interface effect:
Related code:
The search box form elements are not all in the form of a text box, but instead support the types of dates, drop-down boxes, and so on, these editors can be extended and theoretically generic. For example, the shipping city can be configured as a dropdown box to select:
display: "City", Name: "ShipCity", Newline:true, Labelwidth: 100 , Width: 220, space: 30, type: "select", CssClass: "Field", options:{
URL: ". /handler/select.ashx ? view=orders& Idfield=shipcity&textfield =shipcity& Distinct=true "
}
System Introduction-Detail page (automatic form creation, form auto-loading, form submission)
The form should include three sections, form structure, form data, form submissions:
Form structure: In order to unify the style, the code is concise, the form is also through the "Configuration" (using the Ligerform plugin)
form data: After loading into a record by specifying a view/table name, primary key field name, primary key value, use JS to access each property loaded onto the appropriate control, and update the control's style.
Form submission: Using Jquery.validate to do form validation, using JQuery.form.js to do AJAX submission data
Note two points:
1, update the style of the control: the text box of the form, the drop-down box is a ligerui built-in form element components, these components have Updatestyle method, that is, when the value changes, the interface is not timely response, you can call this method
2, the uniform entrance of form submission is AJAX.ASHX, we pass in type and method, use reflection mechanism to find the corresponding method, pass the requested data (Request.Form) to that method. For example, increase the signature of the Order: Ajaxresult addorders (NameValueCollection form)
The interface is as follows:
System Introduction-Menu/button
The editing of the menu is saved in the form of "row editing" mode, and the pre-commit verification is supported, and the icon is selected in dialog to make the operation easier.
The edit mode of the button is the same as the menu, using the table's "Row editing mode". The corresponding field information is not much, I also recommend this way, rather than open a page.
If you need to edit the whole table at the same time, you can use the table "cell editing mode", such as "Order edit page-order Schedule" in the system
System Introduction-Permission Center
Design ideas the same as the previous version, the use of "user", "Role" = "module", "function" of the rights control. Unclear friends can refer to one of my previous introduction: "General rights Management design database structure Design"
In the interface just use a page, complete the permissions control, the operation is very concise. on a design rule, a role can authorize permission to license. The user, on the basis of the role, is individually set to license, or prohibit.
You can set permissions (either license or prohibit) to the user individually
System Introduction-Data permissions
This version of the new feature, can be in the function permissions (mentioned above) on the basis of further permission control extension, such as the salesperson can only see their own sales orders.
The Ligerfilter filter plugin is used, which is a generic conditional query component. You can customize the type of editor, such as selecting a drop-down box for a role.
Is the edit page, which defines the data permission rule: "The order Viewer can only view their own," "Order Manager and presentation roles can see all".
Administrators will never be restricted by data permissions
Note that there are 5 selectable user information parameters, which can be expanded here according to business requirements
5 User Information parameters The following matching relationships will be returned in the organization's final database execution statement, which can be well extended.
restrictions on data permissions always: {field name condition allowed value}
Lists all the fields of the order table, and adds several user parameters to facilitate the specific allocation of permissions.
Using the Ligerfilter editor customizable features, here the current user information can be selected in the dropdown box, you can even change to select in the Pop-up window.
System Introduction-Field permissions
If the data permission is extended to feature permissions vertically, then the field permission is extended horizontally. You can suppress access to certain fields from the specified user/role, which is also added to this version:
System Introduction-drop-down box application details
Drop-down boxes in the system are very classic applications, such as the drop-down box tree, drop-down box table, drop-down box in the pop-up window to select data. Here are some details of the application
Users select from the Department tree:
In fact, the system for the drop-down box to select the data of the various situations are generalized, only need to simple configuration information can be implemented in the specified data source, for example, only need to configure:
is a drop-down box tree instance, and then look at the normal drop-down box:
Both cases load all the data, if the drop-down box data source is large, we certainly do not want to load all the data at once, but can be in the pop-up, paged, filtered tables to select data, which will make the application of the form more humane. Based on this requirement, the Openselect method is extended in this system to the dropdown box plug-in, only need to specify grid configuration parameters, search configuration parameters (optional), return the field name, you can quickly implement this application. You can refer to the system "select customer in order" and "Select Supplier in Product".
Code:
Conclusion
This version of the "Delete and change" commonly used operations encapsulation more thoroughly, greatly enhanced the processing power of client JavaScript, and server-side just play the role of data processing.
Grid, tree, and various form plug-ins are used extensively in the system to show much more about the use of Ligerui's features.
There are also a lot of details and usage tips, such as the introduction of product in order Detail editing table, tab option Delay loading. Are awaiting your experience and advice.
Welcome feedback: http://bbs.ligerui.com
Share a Ligerui-based system application case LIGERRM V2 (Rights Management System) (download available)