First, the structure is generally divided into B/s (browser/server) and C/S (client/server), we use is based on B/s structure.
where B is primarily a page composed of some controls, mainly controlled by JScript,
The S is mainly controlled by the SSL code, divided into Server script and Data Sources, first of all, the difference between the two (Server script with SS instead, Data Sources with DS instead):
- For our lims system, the most common operation is to the database of the increase, delete, change, check, wherein the "check", that is, the operation of the data from the database is generally done by the DS, that is, the data in the database "Take Out", the other three increase, delete, Change and some of the specific needs to return the results of the query to be implemented with SS, that is, the data for the specific operation .
- For DS, more attention to results, generally need to return data, usually return data sets, usually need to be implemented with GetDataSet (), for the SS, more attention to the process, that is, the process of executing an SQL statement, by using the SQLExecute () function to execute the SQL statement, can return different types of data, you can implement some complex functions,
- For DS and SS, the DS setting receives values directly behind the value: =, while for SS it is required to write: default, to implement set defaults
- For this system, the use of DS and the use of the SS to return data is not the same, the data returned with DS is generally a data set, the background is generally the return of the data with XML specification of the data is structured processing, to obtain a certain specification of the XML document, Then the front end is received and then the XML document is parsed according to the corresponding rules, and the data returned by SS is not structured with the SML specification, and the data is returned directly. (The main purpose of XML is to separate the data and the application that uses the data, which facilitates the formatted transmission of the data data.)
- Server script Common function collation:
-
- :P arameters function: in order to get passed the parameter values, such as :P arameters suppcode;
- :D efault function: define default values for parameters, such as :D efault suppcode, "";
- :D eclare function: custom parameters, such as :D eclare Exists;
- SQLExecute () function: Execute SQL statement
1 1 function: Execute SQL statement 2 2 parameter: SQLExecute (SQL Statement, DATASOURCE), SQL statement is the SQL statement executed, Datasource is the data source, generally does not write, defaults to the current system is connected to the data source. 3 3 return value: If the Execute SELECT statement returns a two-dimensional array, Other statements return logical values.
view code
- runsql () &NB Sp function: executes a non-select SQL statement,
1 " insert into materials (Matcode) VALUES (?) " ,,{matcode}); Note: The SELECT statement cannot be executed 2 2 3 3 return value: Returns the logical value.
view code
- Execfunction () function: Execute external function
1 1 function: Execute external function 2 2 parameters: Execfunction (ActionId, {Array of Parameters}), ActionId to call function pathname, can call file in server script and data sources Parameters is the value of the passed function, which is received in the calling file. 33 return value: The value returned by the calling function
View Code
:P rocedure strName; function : function of an executable program called internally
:P arameters N;
: Endproc;
Doproc ("StrName", {n});
1 1 Function : Function of an executable program called internally 2 2 Parameters: Doproc ("<ProcName>", [{<parameters array>}]); ProcName is the calling program name; The parameters array is the argument passed to the calling program. 33 return value: Any value returned by the calling program
View Code
- : IF (); Function: Logical judgment
: ELSE;
: ENDIF;
: Begincase; Function: Branch Selection
: case;
: Exitcase;
: OTHERWISE;
: Endcase;
- : Return function: Value returned
- Usrmes (); Function: Log in server script and data sources,
1 function: Log logs in server script and data sources, Shown in the IED Environment server log, does not affect code execution, for example: 2 :D Eclare Teststr; 3 teststr: = aaa " 4 usrmes ( " parametersname " ,teststr); 5 parameter: usrmes ( parametersname " ,teststr); Parametersname is the custom display name, TESTSTR is the variable name to display 6 return Value: String, displayed in server log
View Code
2. Data sources commonly used function collation:
-
- :P arameters function: Gets the parameter value passed in order, setting the default value differs from the server script, which needs to be specified directly after the parameter. such as folderno:= ' A00004412 ';
- :D eclare function: custom parameters, such as :D eclare Exists;
- GetDataSet(); Features:Execute the parameters of the SQL statement to return a dataset in the database
1 function: Execute the parameters of the SQL statement to return a dataset in the database2 parameters: GetDataSet (strSQL, Arrparamsvalues, Bwithschema). The SQL statement executed by strSQL; Arrparamsvalues is a parameter passed to the SQL statement, not required; Bwithschema generally not, the default is true. For example:3:P arameters matcode:="', startddate:="',4expdate:="';5 :D eclare strSQL, Strtoday;6strSQL: ="SELECT * from Mfginstructions7WHERE (expdate isNULL and matcode=?) or (matcode= and Startddate <=? and Expdate >=?)";8 : RETURN getdataset (strSQL, {matcode, Matcode,9 today (), Today ()});TenReturn value: DataSet data set
View Code
- Getdatasetfromarray () function: Returns a DataSet from an array
1 parameters: Getdatasetfromarray (arrvalues, Arrfields). Arrvalues, a two-dimensional array; arrfields, optional, is the field name corresponding to the two-dimensional array in the returned dataset, the default is Field1, Field2 ... In turn. You can also customize the field name, but the field name needs to be the same as the number of columns in the two-dimensional array, and only the data that defines the field is returned if less than the number of columns. 2 return value: DataSet DataSet
View Code
- Lsearch();Features:Used to search for field values.
1 function: Used to search for field values. The function uses an SQL SELECT expression to find the value of a specific field and returns the value, and if the field value does not exist, returns the value by default, and returns the first column of the first row if multiple fields are searched. For example:2Lsearch ("Select Matno from MATERIAL where Origrec = 5","No Material","DATABASE")3Returns the Matno field value of the Origrec =5, otherwise returns"No Material". 4 parameters: Lsearch (SELECT Expression, Default, Database). Expression is the SELECT statement to execute; default is the value returned, the database is the data source, it is not normally set, and is assumed to be the current databases. 5Return value: Field value or Default value
View Code
3. Client Common function collation:
- function Form1_oninit (sender, EventArgs) functionality : Executes this function in code View when the form is initialized
- function Form1_onload (Sender,eventargs) feature: executes this function when the form is loaded View code
- function Form1_onshow (sender, EventArgs) feature: executes this function in code View When the form is displayed
- function Form1_onclose (sender, EventArgs) feature: executes this function in code View When the form is closed
- form. ShowModalDialog () function: call form View Code
- Form. ShowModalDialog () has not been used, to be determined.
- LIMs. CallServer () function: Call Server Scripts-side code
- LIMs. GetData (Note the difference from the lims.getdatasource below)View Code
- LIMs. Getdatasource () function: Call the data Sources end code
- LIMs. GetDataSet () function: Call the data Sources end code
- the difference between Dgdatagrid.refresh () and Dgdatagrid.refreshex () is: View Code
- form.formarguments function : Call data sources side code View Code
Form.returnvalue function : Return a value to the calling form
View Code
- form. Variables function: global variable of the current form View Co De
- Navigator. variables["starlimsdept"] function:The global variable of application, defined anywhere in the current application, can be taken in any place. View Code
- Dialogs.messagebox () Features: pop-up message dialog box View Code
- alert () function: displays variable or object values, often used for debugging View Code
try{} catch (Ex:exception) {} function: exception handling, similar to exception handling in Java
2015-8-25-knowledge of the backend and general function collation