Example #1
0
        public DatabaseQueries GenerateDatabase(DataProviders provider, Questionaires importedDataObjects = null)
        {
            DatabaseQueries queries = new DatabaseQueries();

            if (importedDataObjects == null)
            {
                foreach (Questionaire dataObject in _questionaires)
                {
                    queries.Append(dataObject.GenerateDatabase(provider));
                }
            }
            else
            {
                //first drop
                DataCollectionObject configObj = null;

                foreach (Questionaire form in importedDataObjects)
                {
                    configObj = ByKey(form.Key);
                    if (configObj == null)
                    {
                        //drop it
                        queries.Append(form.DropTable());
                    }
                }


                ////first check the cached config and add a data object thats missing
                foreach (DataCollectionObject form in _questionaires)
                {
                    var importedDataObject = importedDataObjects.ByKey(form.Key);
                    if (importedDataObject == null)
                    {
                        queries.Append(form.GenerateDatabase(provider));
                    }
                }
            }
            return(queries);
        }
Example #2
0
 public override DatabaseQueries GenerateDatabase(DataCollectionObject importedForm, bool checkForeignKeys, DataProviders provider)
 {
     return(base.GenerateDatabase(importedForm, checkForeignKeys, provider));
 }
Example #3
0
 public override DatabaseQueries GenerateDatabase(DataCollectionObject importedForm, DataProviders provider)
 {
     return(base.GenerateDatabase(importedForm, provider));
 }