Skip to content

Instantly share code, notes, and snippets.


roticSamurai amarodeabreu

  • Matt Black Consulting
  • South Africa
View GitHub Profile
View IBAction - showAlert().swift
// 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
//Present action on view controller with animation
View DeTabString.vb
Function DeTabString(p_strInput)
Const TAB_SIZE = 8
Const FILLER = " "
Dim strInput, intCounter
strinput = p_strInput
DeTabString = ""
View Query DB Stored Proc Dataset Return.cs
/// <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)
View SYSPRO WCF Transaction Call.cs
/// <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
View Get DB Tables.cs
/// <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";
var dtDatatable = QueryDatabase(ConnectionString, sql).Tables[0];
View Get DB Key Columns For Selected Table.cs
/// <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;
View VBScript BO Tools.vb
'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
View VBScript DB Tools.vb
'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
View Requisition Workflow View.sql
GetFlowDetails (@KeyId varchar(50))
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
View Get DB Table Columns From DB Schema.cs
/// <summary>
/// Get table columns from db schema
/// </summary>
public void GetColumns()
// New table column class
_tableColumnsArrayList = new List<TableColumns>();
// Get db name from settings file
var database = Properties.Settings.Default.Database;