Class JsonConverter
This class converts string array to json or javascript object and return as a string.
Inheritance
Inherited Members
Namespace: SDBCS.utility
Assembly: SDBCS.dll
Syntax
public class JsonConverter
Remarks
Author Mehmet Hayati KINAŞ
Version 1.0
Constructors
JsonConverter(String[])
The constructor sets messages for converting to json or javascript object
Declaration
public JsonConverter(string[] messages)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | messages |
JsonConverter(String[], Boolean)
This constructor set field names if foo is true.
Declaration
public JsonConverter(string[] fieldNames, bool foo)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fieldNames | |
System.Boolean | foo |
JsonConverter(String[], String[][], ExecuteTable)
This class converts string array to json or javascript object and return as a string.
Declaration
public JsonConverter(string[] fieldNames, string[][] tableData, ExecuteTable executeTable)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fieldNames | Names of fields of the table to access. |
System.String[][] | tableData | Table data in the form of string [number of records] [number of fields]. |
ExecuteTable | executeTable | The ExecuteTable instance for getting default messages. |
Methods
conv2ExcelCols(String[], Int32[])
This method converts label names, field names and column widths to javascript object string for excel columns.
Declaration
public string conv2ExcelCols(string[] labelNames, int[] colWidths)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | labelNames | Label names string array |
System.Int32[] | colWidths | Column widths integer array. |
Returns
Type | Description |
---|---|
System.String | avascript object string value. |
convert2JSobj()
This method use fieldNames, tableData, executeTable for converting to javascript object and return as a string Also it use convertMessages for messages string and add in to final string
Declaration
public string convert2JSobj()
Returns
Type | Description |
---|---|
System.String | String for javascript object |
convert2Json()
This method use fieldNames, tableData, executeTable for converting to json and return as a string Also it use convertMessages for messages string and add in to final string
Declaration
public string convert2Json()
Returns
Type | Description |
---|---|
System.String | String for json |
convert2Lists(Int32[], String[][])
This method convert string array of reference list to javascript object as a string
Declaration
public string convert2Lists(int[] refFieldMatchs, string[][] selLists)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | refFieldMatchs | Field names list will be checked for listing with this parameter |
System.String[][] | selLists | Reference list string array from DB |
Returns
Type | Description |
---|---|
System.String | Javascript object string value |
convLog2Json(Int32)
The method sets log data index value and return json string value for log values.
Declaration
public string convLog2Json(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Log data index number at log table fields. |
Returns
Type | Description |
---|---|
System.String | Json string value |
getMessageList(Boolean)
For getting message list as a json or javascript object.
Declaration
public string getMessageList(bool isObj)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isObj | If it is javascript object set true, else set false |
Returns
Type | Description |
---|---|
System.String | String for json or javascript object |
set4Logs(Int32)
The method sets log data index value and isLog to true.
Declaration
public void set4Logs(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Log data index number at log table fields. |