Revision History
Download 1.41 Mb. Pdf ko'rish
|
Lacerte SDK Developer Instructions
- Bu sahifa navigatsiya:
- LacerteTaxSetupRequired
ConsentDenied = 0 (End user denied permission from access control dialogue)
AccessGranted = (End user granted permission from access control dialogue, and successfully signed in SDK) VersionBlocked = (Current version of SDK is outdated and need to update to a new version) NotSignedIn = (end user attempt to sign-in failed by some reason) LacerteTaxSetupRequired = (System missing required Lacerte tax set up) Lacerte Software Development Kit Developer Instructions pg. 23 Database Read Example To read data from the Lacerte datapath use an IDBFReader interface object. This interface is capable of reading all data from the DBF file and gives back as a dataset (XML) which can be plotted or displayed easily on data grid or any controls used to display data in row and column. Steps to read from DBF: 1. Create an instance of ILacerteAccess interface 2. Create an instance of IDBFReader and open Lacerte DBF data as below using CreateDBFReader method 3. ReadFromDBFData gives data in XML format private ILacerteAccess objLacdriver = new LacerteAccess (); IDBFReader objReader = objLacdriver.CreateDBFReader(); string strXMLData = "" ; TAPIStatus Status = bjReader.ReadFromDBFData(strAppID, DataPathName , DBFFileName , ref strXMLData); if ( TAPIStatus .Success == Status) { textBoxReadStatus.Text = "Initializing library" ; StringReader theReader = new StringReader (strXMLData); DataSet theDataSet = new DataSet (); theDataSet.ReadXml(theReader); dataGridViewDBF.DataSource = theDataSet.Tables[ "RECORD" ]; } else if ( TAPIStatus .VersionBlocked == Status) { LogError( "SDK version is outdated, please use new version of SDK" ); } else if ( TAPIStatus .NotRegistered == Status) { LogError( "User permission is not granted for using SDK" ); } else { LogError( "Read failed, either no permission to read or fatal error." ); } Reading data as COM Object Dim strXMLData As String Dim AccessObj As LacerteSDK_Access.LacerteAccess Dim ReaderObj As LacerteSDK_Interfaces.IDBFReader Set AccessObj = New LacerteSDK_Access.LacerteAccess Dim Status As TAPIStatus Set RegObj = AccessObj.CreateDBFReader Status = ReaderObj.ReadFromDBF("987799", "C:\Lacerte\18Tax\IDATA\", "DATA1I18.DBF", strXMLData) On a successful read a sample strXMLData appears as follows: Lacerte Software Development Kit Developer Instructions pg. 24 Parameters for ReadFromDBFData– 1. String – AppID – AppID used for calling Register function 2. String – DataPath (Directory path to Lacerte datapath e.g C:\Lacerte\18Tax\IDATA) 3. String – DBFName – DBF Name which need to read e.g DATA1I18.DBF 4. Ref String – XML – output data from the DBF file with rows and columns formatted Return Status: APIStatus - Refer to the table below for output values from this API. Summary: The ReadFromDBFData method from COM/.Net Library will read the entire DBF data file to an XML string. Database Write Example Similar to the read operation, a write can be performed with below steps: IDBFWriter objWriter = objLacdriver.CreateDBFWriter(); string strNewValue = "" ; TAPIStatus iStatus = 0; Int iRowNum = 2; if ( TAPIStatus .Success == (iStatus = objWriter.WriteToDBFDatabase( DataPathName , DBFName, iRowNum, “C1_36”, 3, r ef strNewValue))) { LogDebug(“Write to field C1_36 succeeded”); } else if (iStatus == TAPIStatus .OutOfIndex) { LogError(“ Out of index write attempt ”); } else if (iStatus == TAPIStatus .NotRegistered) { LogError(“ User permission is not granted for using SDK ”); } else { LogError(“ Failed, Either field is not exposed for write failed, Status =" + iStatus.ToString()); } Lacerte Software Development Kit Developer Instructions pg. 25 Database write as a COM object Dim strNewValue As String Dim AccessObj As LacerteSDK_Access.LacerteAccess Dim WriterObj As LacerteSDK_Interfaces.IDBFWriter Set AccessObj = New LacerteSDK_Access.LacerteAccess Dim Status As TAPIStatus Set RegObj = AccessObj.CreateDBFWriter Status = WriterObj.WriteToDBFDatabase("987799", "C:\Lacerte\18Tax\IDATA\", "DATA1I18.DBF", 2, "C1_36", "3", strNewValue) Parameters for WriteToDBFDatabase 1. String –AppID (App ID which is used for registering) 2. String – DataPath (Lacerte Datapath directory) 3. String – DBFName – DBF name to perform write 4. int – RowNum – Row number of the client to perform write 5. String – Fieldname to which performing write 6. String – Value (Value to be written) 7. Ref string – newValue – Return value after a successful write Return Status: APIStatus – Refer table below for detailed status. Download 1.41 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling