This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Generic type SQL Query Fetch | |
/// </summary> | |
/// <typeparam name="T">Generic</typeparam> | |
/// <param name="connectionString">SQL Connection string</param> | |
/// <param name="sql">SQL select query</param> | |
/// <returns>List Object of type inferred</returns> | |
public async Task<IEnumerable<T>> QueryTask<T>(string connectionString, string sql) | |
{ | |
using IDbConnection db = new SqlConnection(connectionString); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to display UIAlert when "Hit Me!" button is clicked | |
@IBAction func showAlert(){ | |
//New instance of UIAlertController - Apple view controller | |
let showAlert = UIAlertController(title: "Hello, World", message: "This is my first swift app", preferredStyle: .alert) | |
//New instance of UIAlertAction - Apple view controller action | |
let action = UIAlertAction(title: "Awesome sauce", style: .default, handler: nil) | |
//Add action to view controller | |
showAlert.addAction(action) | |
//Present action on view controller with animation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function DeTabString(p_strInput) | |
Const TAB_SIZE = 8 | |
Const FILLER = " " | |
Dim strInput, intCounter | |
'Initialise | |
strinput = p_strInput | |
DeTabString = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// QueryDatabase method that allows stored procedure calls | |
/// </summary> | |
/// <param name="connectionName"></param> | |
/// <param name="storedProcedure"></param> | |
/// <param name="parameters"></param> | |
/// <returns></returns> | |
public DataSet QueryDatabase(string connectionName, string storedProcedure, | |
Dictionary<string, string> parameters) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Do SYSPRO login | |
/// </summary> | |
/// <param name="businessObjectName"></param> | |
/// <param name="xmlParameters"></param> | |
/// <param name="xmlIn"></param> | |
/// <returns>XmlDocument</returns> | |
public static void DoTransaction(string businessObjectName,string xmlParameters, string xmlIn) | |
{ | |
//the binding to use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Get database tables to populate grid | |
/// </summary> | |
private void GetTables() | |
{ | |
// Get all SQL tables for the db defined in the settings file | |
var sql = "SELECT TABLE_NAME As Tables FROM " + Properties.Settings.Default.Database + ".INFORMATION_SCHEMA.TABLES with (nolock) WHERE TABLE_TYPE = 'BASE TABLE' ORDER BY TABLE_NAME ASC"; | |
try | |
{ | |
var dtDatatable = QueryDatabase(ConnectionString, sql).Tables[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Get primary key columns for selected table | |
/// </summary> | |
private void GetKeyColumns() | |
{ | |
// New key column class | |
_tableKeyColumnsArrayList = new List<TableKeyColumns>(); | |
// Get db name from settings file | |
var database = Properties.Settings.Default.Database; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'boPost(BusinessObject, XMLParam, XMLDoc, KeyNode) | |
'Function boGetValues(sXmlOut, sNode) | |
'Function boLogBusinessObject(sType, sKey, sXMLParam, sXMLDoc, sXMLOut) | |
'Syspro WCF Service REST Address | |
Dim Wcf | |
Wcf = "http://localhost:20000/SysproWCFservice/REST/" | |
Public sBoError | |
Public sBoXmlOut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Function dbGetRecordset(sSql) | |
'Function dbPost(sPost) | |
'Function dbCloseConnection() | |
'Used to enter db details. Returns Conn | |
Conn = "Provider=SQLNCLI10;Server=.;Uid=sa;Pwd=xxx;Connect Timeout=120;DATABASE=" | |
Public cn, rs | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE | |
GetFlowDetails (@KeyId varchar(50)) | |
AS | |
BEGIN | |
Select A.Name, B.Value, MaxInst From | |
(SELECT Name, MAX(ActivityInstanceId) As MaxInst FROM [dbo].[TrackingDetailVariables] | |
WHERE WorkflowName = 'RequisitionBOPosting' AND KeyId LIKE @KeyId + '%' | |
Group By Name) A JOIN | |
(SELECT Name, Value, ActivityInstanceId FROM [dbo].[TrackingDetailVariables] | |
WHERE WorkflowName = 'RequisitionBOPosting' AND KeyId LIKE @KeyId + '%') B ON B.Name = A.Name AND B.ActivityInstanceId = MaxInst |
NewerOlder