private void button2_Click(object sender, EventArgs e) { string sConnString = "Server Name=localhost;Database Name=LSYNC;"; using (PsqlConnection oPastelConn = new PsqlConnection(sConnString)) { oPastelConn.Open(); Cursor = System.Windows.Forms.Cursors.WaitCursor; solPastelSDK clsPastelSDK = new solPastelSDK(); string[] aLines = new string[2]; aLines[0] = "0|1|105.28|120|DAY |1|0|0|023PHIREDRILL|DRILL HILTI TE16 |4|001| |"; // aLines[0] = "0|1|162.28|162.28|DAY |0|0|0|039PHIREGENERA|6KVA GENERATOR HONDA MGS6000 |4|001| |"; aLines[1] = "0|1|0.02|0.02| |0|0|0|1000020 |Rounding |6|001| |"; string sHeader = "|||ABS001|05/02/2010|IN100159|Y|0|||||||||00001|0||2010/02/05 12:00:00 AM||Blondie||1|||||||||26477506|0"; string sDataPath = "C:\\Pastel09\\FAIREGLEN"; string sResult = clsPastelSDK.CreatePastelDocument(sHeader, aLines, 106, sDataPath, Global.iPastelSdkUser, false, oPastelConn, 1); MessageBox.Show(sResult); //CreatePastelDocument(sHeader, aLines, 106, sDataPath, Global.iPastelSdkUser, Global.bLogCreateDocument); //txtSdkResults.Text = sResult; Cursor = System.Windows.Forms.Cursors.Default; } }
private void cmdInvoice_Click(object sender, EventArgs e) { Cursor = System.Windows.Forms.Cursors.WaitCursor; solPastelSDK clsPastelSDK = new solPastelSDK(); string[] aLines = new string[3]; aLines[0] = "0|0|0|0| |0|0|0|' |Invoiced: 09/11/09-09/11/09: 1 Day |7|001| |"; aLines[1] = "0|1|105.26|120|DAY |1|0|0|020PHIREDRIVE |DRIVE UNIT HONDA GX160 |4|001| |"; aLines[2] = ""; string sHeader = "|||MEGAPA|2009/11/06 12:00:00 AM|IN100100|Y|0||||VAT # 4410172417|POST-NET 17|PRIVATE BAG X 1013|PHALABORWA, 1390||00001|0||2009/11/06 12:00:00 AM|0157812461|DEON BEESELAAR|0157812314|1|||VAT # 4410172417|POST-NET 17|PRIVATE BAG X 1013|PHALABORWA, 1390|PHALABORWA, 1390|||0"; //string sResult = clsPastelSDK.CreatePastelDocument(sHeader, aLines, 106, Global.sDataPath, Global.iPastelSdkUser, Global.bLogCreateDocument); //txtSdkResults.Text = sResult; Cursor = System.Windows.Forms.Cursors.Default; }