Drop-down box data binding & multi-criteria query

Drop-down box data binding & multi-criteria query

文献种类:专题技术文献;
开发工具与关键技术:  VS         
 作者:  卢媛媛   ;
 撰写时间: 2019  年   4 月  13 日 
  1. Data Binding drop-down box that is well understood that a series of operations carried out by ID; Here Insert Picture Description
    Ø createSelect () is a method among JS,
    Ø by this simple method can also be used in a number of the amount of code can be called directly,
    $ (function ( ) {// department drop-down box data binding
    createSelect ( "searchDepartmentID", "selectDepartment");
    // department drop-down box to change the data, trigger data binding drop-down box office $ ( "# searchDepartmentID") change (function (.) {
    // get the selected department ID
    . departmentId var = $ ( "# searchDepartmentID") Val ();
    // bind position drop-down box
    createSelect ( "searchPositionID", "selectPosition the departmentID =?" + departmentId);
    });

    Ø selected one of the first ID, the second path, the third property value or return value may be set options. (The third property value involved is relatively small)
    Ø Change () when the value of the element of change, change events occur
    Note: When used for select elements change events occur when selecting an option. When a text field or text area, the event occurs when the element loses focus.
    Ø In the drop-down box binding posts are used path stitching, is also the first ID, the second method is behind? The splicing of the desired condition change data binding dropdown rear door;

Also known as multi-condition combination query query; So what is multi-criteria query?

Multi conditions arbitrarily selected query method,
for example, the query conditions A, B, C, D, E, F but conditions are used each may be different, for example: the first B, E, F; second times are a, D, F; third is C, D, E;
is like this, C # inside the query should be how to write?
first of all multi-condition combination to get to the first query query conditions; conditions affirms the required ID
. var DepartmentID = $ ( "# searchDepartmentID") val (); // department
var PositionID = $ ( "# searchPositionID ") val ();. // position
var EmployeeDetail = $ ( "# searchEmployeeDetail ") val (). ; // number & name

Determining a second data type; (int type or string type)
(. 1) IF (the DepartmentID == "" || the DepartmentID == undefined) {the DepartmentID = 0;}
Note: Int main types of null or undefined determines whether or let him 0;
(2) IF (EmployeeDetail == undefined) {
EmployeeDetail = "";}

  注释: string类型就有点不一样了,判断是否为undefined否则为空;

Lambda expressions are used in the controller again screening
Here Insert Picture Description
of type int and string type or a separate area in the screen;
looks more intuitive in type int, then you need to determine the type of string is empty;
! IF (String.IsNullOrEmpty ()) {} IsNullOrEmpty ()
mainly string parameter passed is judged, when the string is null or empty string returns true; otherwise returns false.
Contains (); String type there is a method:

注释: contains(),该方法是判断字符串中是否有子字符串。如果有则返回true,如果没有则返回false。

Select selector element containing a specified string.
The string can be included directly in the text elements, or be included in the sub-element.
Often used in conjunction with other elements / selector,To select the desired group containing the specified text element matching elements described mainly contains the given text;
Here Insert Picture Description
Or may additionally wording;
Here Insert Picture Description
addition, although the wording but inconsistent effect the Contains () of this method are the same; one is among Jquery selector;

Guess you like

Origin blog.csdn.net/qq_42577408/article/details/89338439