You are on page 1of 3

Genesis Library / API Documentation

Getting Started

The latest version of the library source code is located at DEVELOPMENT-CENTRAL\For_IT\


GenesisLibrary.7z

Initiate Library Instance


using GenesisLibrary;

Uploader up = new Uploader(


“Server=localhost;Port=5432;Database=genesis;User Id=oos; Password=it-oos;”,
“ctcfm”,
“staging”,
“D:\AppDev\Genesis\test\temp”,
new string[] {“column1”, “column2”);

To upload an excel file to Genesis


List<GenesisDuplicate> duplicates;
var uploaded = up.UploadFiles(filenames, out duplicates);

To get a record from Genesis using Data ID


gdr = new GenesisDataRow();
gdr.GetRecord(“staging”,
111,
“ctcfm”,
“Server=localhost;Port=5432;Database=genesis;User Id=oos; Password=it-oos;”,
“);

Versions

Version Date Changes


V1.0.0 25-APR-2019 Initial Version
Classes

Uploader – contains the necessary methods on uploading an excel file to Genesis

GenesisDataRow – class definition on one record / row from Genesis

GenesisDuplicate – class definition for a duplicate record found during upload

SimFlex – contains the necessary methods on SimFlex job operations

SimFlexBatch – class definition on a batch record for SimFlex

SimFlexJob – class definition on a job record for SimFlex

SimFlexRegistration – class definition on a registration object for SimFlex

Uploader Class

Methods
Uploader(string genesisConnectionString, string genesisTableName, string
genesisCollectionName, string tempFolder, string[] columnDuplicateCheck)

- Constructor that initializes the instance for upload to Genesis


public GenesisDataRow UploadData(GenesisDataRow d)

- Upload one GenesisDataRow to Genesis


public void RegisterToSimFlexByJob(SimFlexJob job, string SimFlexConnString)

- Register a job to SimFlex


public void RegisterToSimFlexByJob(List<SimFlexJob> jobs, string SimFlexConnString)

- Register a list of jobs to SimFlex


public List<GenesisDataRow> UploadFiles(string[] xlfiles, out List<GenesisDuplicate>
duplicates, string[] autoCreateColumns = null, string[] columnsToDedup = null, string[]
statusColumns = null)

- Upload an array of excel files names to Genesis

GenesisDataRow Class

Methods
public string GetHash(params string[] columnNames)

- Generates a SHA512 hash of the values as specified in the columnNames parameter.


public string[] Row

- Generates a string array of the values


public string[] GetHeaders()

- Generates an array of string of the headers or column names


public string GetValueInColumn(string colname)

- Returns the values of the specified column name in colname parameter


public bool Contains(string s)

- Returns true if the value of one of the columns of the record contains the string s
public GenesisDataRow GetRecord(string Collection, int DataID, string TableName, string
GenesisConnectionString)

- Returns the GenesisDataRow object based on Collection, DataID and Table Name
public static List<string> GetDistinctValues(string Collection, string ColumnName, string
TableName, string GenesisConnectionString)

- Returns a list of strings of all distinct values of a specific column based on Collection and Table
Name
public static GenesisDataRow GetDataRow(string Collection, string ColumnName, string
Value, string TableName, string GenesisConnectionString, bool CaseSensitive)

- Returns a GenesisDataRow object based on Collection, Table Name, Column Name and Column
Value
public static GenesisDataRow GetDataRow(string Collection, string SheetName, string
ColumnName, string Value, string TableName, string GenesisConnectionString, bool
CaseSensitive)

- Returns a GenesisDataRow object based on Collection, Table Name, Sheet Name, Column Name
and Column Value
public static void UpdateGenesisDBDataRow(List<GenesisDataRow> rows, string TableName,
string GenesisConnectionString)

- Updates the records in Genesis for a specific Table Name using the list of GenesisDataRow
parameter.
public static void UpdateGenesisDBDataRow(GenesisDataRow gdr, string TableName, string
GenesisConnectionString)

- Updates a record in Genesis for a specific Table Name using a GenesisDataRow parameter.

SimFlex Class

Methods
public static void SimFlexJobDone(string jobName, string loginName, string
SimFlexConnectionString)

- Marks a SimFlex Job as Done

You might also like