Ejemplo n.º 1
0
        public DatabaseQueries Insert()
        {
            DatabaseQueries dbQueries = new DatabaseQueries();

            DatabaseQuery dbQuery = new DatabaseQuery();

            dbQuery.FriendlyMessage = "inserting into dsto_section";

            string query = string.Empty;

            query += string.Format("INSERT INTO dsto_questionaire (guid,name,yref_questionaire) values('{0}','{1}')", Key, Name, Parent.Parent.Key);
            dbQuery.SqlStatement = query;
            dbQuery.Name         = TableName;
            dbQuery.Message      = Messages.InsertRecord;
            dbQueries.Add(dbQuery);


            return(dbQueries);
        }
Ejemplo n.º 2
0
        internal DatabaseQueries GenerateSectionsXQuestionTable(DataProviders provider)
        {
            DatabaseQueries databaseQueries = new DatabaseQueries();
            DatabaseQuery   dbQuery         = new DatabaseQuery();

            dbQuery.Name    = "dsto_sectionXquestion";
            dbQuery.Message = Messages.CreateTable;
            var query = "create table dsto_sectionXquestion\n";

            query += "(\n";
            query += "oid int identity(1,1) primary key,";
            query += "guid uniqueidentifier default newid(),";
            query += "created_on datetime getdate(),";
            query += "created_by varchar(50),";
            query += "lastupdated_by varchar(50),";
            query += "lastupdated_on datetime,";
            query += "yref_question uniqueidentifier references [dsto_questions]([guid]),";
            query += "yref_section uniqueidentifier references [dsto_sections]([guid])";
            dbQuery.SqlStatement = query;
            return(databaseQueries);
        }