using SwanCSharp.DataAccess;
using System;
using System.Collections.Generic;
using System.Text;

namespace DatabaseCreation
{
    class Program
    {
        private static DBStruct[] lobjStruct;

        static void Main(string[] args)
        {
            lobjStruct = new DBStruct[8];

            lobjStruct[0].TableName = "Staff";
            lobjStruct[0].FieldName = "IDPerson";
            lobjStruct[0].FieldType = "int";
            lobjStruct[0].PrimaryKey = true;
            lobjStruct[0].Identity = true;
            lobjStruct[0].NotNull = true;

            lobjStruct[1].TableName = "Staff";
            lobjStruct[1].FieldName = "Name";
            lobjStruct[1].FieldType = "varchar(20)";
            lobjStruct[1].PrimaryKey = true;
            lobjStruct[1].Identity = false;
            lobjStruct[1].NotNull = true;

            lobjStruct[2].TableName = "Staff";
            lobjStruct[2].FieldName = "Lastname";
            lobjStruct[2].FieldType = "varchar(20)";
            lobjStruct[2].PrimaryKey = false;
            lobjStruct[2].Identity = false;
            lobjStruct[2].NotNull = true;

            lobjStruct[3].TableName = "Staff";
            lobjStruct[3].FieldName = "Street";
            lobjStruct[3].FieldType = "varchar(50)";
            lobjStruct[3].PrimaryKey = false;
            lobjStruct[3].Identity = false;
            lobjStruct[3].NotNull = true;

            lobjStruct[4].TableName = "Staff";
            lobjStruct[4].FieldName = "City";
            lobjStruct[4].FieldType = "varchar(50)";
            lobjStruct[4].PrimaryKey = false;
            lobjStruct[4].Identity = false;
            lobjStruct[4].NotNull = true;

            lobjStruct[5].TableName = "Auxiliary";
            lobjStruct[5].FieldName = "IDPerson";
            lobjStruct[5].FieldType = "int";
            lobjStruct[5].PrimaryKey = true;
            lobjStruct[5].Identity = false;
            lobjStruct[5].NotNull = true;

            lobjStruct[6].TableName = "Auxiliary";
            lobjStruct[6].FieldName = "DischargeDate";
            lobjStruct[6].FieldType = "datetime";
            lobjStruct[6].PrimaryKey = false;
            lobjStruct[6].Identity = false;
            lobjStruct[6].NotNull = false;

            lobjStruct[7].TableName = "Auxiliary";
            lobjStruct[7].FieldName = "Salary";
            lobjStruct[7].FieldType = "int";
            lobjStruct[7].PrimaryKey = false;
            lobjStruct[7].Identity = false;
            lobjStruct[7].NotNull = false;

            SQLServer();
            Access();
        }

        private static void SQLServer()
        {
            DatabaseStructure lobjDataBase  = new DatabaseStructure("PC1234\\SQLEXPRESS", "DataBase", lobjStruct);
        }

        private static void Access()
        {
            DatabaseStructure lobjDataBase = new DatabaseStructure("DataBase.mdb", "", "", lobjStruct);
        }
    }
}
