Beispiel #1
0
        private void btnPrevious_Click(object sender, EventArgs e)
        {
            Setup1 setup1 = new Setup1(parentForm);

            setup1.ShowDialog();
            this.Close();
        }
Beispiel #2
0
 private void btnPrevious_Click(object sender, EventArgs e)
 {
     Setup1 setup1 = new Setup1(parentForm);
     setup1.ShowDialog();
     this.Close();
 }
Beispiel #3
0
        private void InitDatabase()
        {
            // create a new database connection:
            sqlite_conn = new SQLiteConnection("Data Source=database.db;Version=3;Compress=True;");

            try
            {
                // open the connection:
                sqlite_conn.Open();
            }
            catch (Exception e)
            {
                Console.Write(e.ToString());
                sqlite_conn = new SQLiteConnection("Data Source=database.db;Version=3;Compress=True;New=True;");
                sqlite_conn.Open();
            }


            // create a new SQL command:
            sqlite_cmd = sqlite_conn.CreateCommand();

            if (!TableExists(sqlite_conn, "ProgramConfig"))
            {
                Console.WriteLine("New Install Detected, prompt for school info.");
                //Create the table.
                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE ProgramConfig (
                        id integer primary key, 
                        sPassword varchar(20),
                        sEmail varchar(40),
                        sSchoolName varchar(50),
                        sAddress varchar(40),
                        sCity varchar(20),
                        sState varchar(20),
                        sZip varchar(20),
                        sLatitude varchar(20),
                        sLongitude varchar(20),
                        sImageFile varchar(80),
                        sDatabaseVersion varchar(10)
                        );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                Form newForm = new Setup1(this);
                newForm.ShowDialog();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE People (
                id integer primary key, 
                stxtFname varchar(20),
                stxtLname varchar(20),
                stxtPhone varchar(20),
                stxtAddress varchar(40),
                stxtCity varchar(20),
                stxtState varchar(20),
                stxtZip varchar(20)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();


                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Ranks (
                id integer primary key, 
                sTitle varchar(20),
                sColor varchar(20),
                iPointsRequirement integer,
                iTimeRequirementInDays integer,
                sPathToImageFile varchar(60)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Students (
                id integer primary key, 
                iPerson integer,
                iRank integer
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE EmergencyContacts (
                id integer primary key, 
                iStudent int,
                iPerson int,
                sRelationship varchar(20)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Guardians (
                id integer primary key, 
                iStudent int,
                iPerson int,
                sRelationship varchar(20)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Class_Sessions (
                class_id integer primary key, 
                class_ud integer,
                class_name varchar(20),
                freq_type integer,
                freq_interval integer,
                freq_relative integer,
                active_start_date integer,
                active_end_date integer,
                active_start_time integer,
                active_end_time integer,
                date_created datetime,
                date_modified datetime,
                bIsKids boolean,
                bIsClosed boolean
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                sqlite_cmd.CommandText = @"CREATE TABLE Attendence 
                (
                    id integer primary key,
                    PersonID integer,
                    Date varchar(25),
                    ClassID integer
                );";
                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();
            }
        }
Beispiel #4
0
        private void editSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form setup = new Setup1(this);

            setup.ShowDialog();
        }
Beispiel #5
0
        private void InitDatabase()
        {
            // create a new database connection:
            sqlite_conn = new SQLiteConnection("Data Source=database.db;Version=3;Compress=True;");

            try
            {
                // open the connection:
                sqlite_conn.Open();
            }
            catch(Exception e)
            {
                Console.Write(e.ToString());
                sqlite_conn = new SQLiteConnection("Data Source=database.db;Version=3;Compress=True;New=True;");
                sqlite_conn.Open();
            }

            // create a new SQL command:
            sqlite_cmd = sqlite_conn.CreateCommand();

            if (!TableExists(sqlite_conn, "ProgramConfig"))
            {
                Console.WriteLine("New Install Detected, prompt for school info.");
                //Create the table.
                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE ProgramConfig (
                        id integer primary key,
                        sPassword varchar(20),
                        sEmail varchar(40),
                        sSchoolName varchar(50),
                        sAddress varchar(40),
                        sCity varchar(20),
                        sState varchar(20),
                        sZip varchar(20),
                        sLatitude varchar(20),
                        sLongitude varchar(20),
                        sImageFile varchar(80),
                        sDatabaseVersion varchar(10)
                        );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                Form newForm = new Setup1(this);
                newForm.ShowDialog();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE People (
                id integer primary key,
                stxtFname varchar(20),
                stxtLname varchar(20),
                stxtPhone varchar(20),
                stxtAddress varchar(40),
                stxtCity varchar(20),
                stxtState varchar(20),
                stxtZip varchar(20)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Ranks (
                id integer primary key,
                sTitle varchar(20),
                sColor varchar(20),
                iPointsRequirement integer,
                iTimeRequirementInDays integer,
                sPathToImageFile varchar(60)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Students (
                id integer primary key,
                iPerson integer,
                iRank integer
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE EmergencyContacts (
                id integer primary key,
                iStudent int,
                iPerson int,
                sRelationship varchar(20)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Guardians (
                id integer primary key,
                iStudent int,
                iPerson int,
                sRelationship varchar(20)
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                // Let the SQLiteCommand object know our SQL-Query:
                sqlite_cmd.CommandText = @"CREATE TABLE Class_Sessions (
                class_id integer primary key,
                class_ud integer,
                class_name varchar(20),
                freq_type integer,
                freq_interval integer,
                freq_relative integer,
                active_start_date integer,
                active_end_date integer,
                active_start_time integer,
                active_end_time integer,
                date_created datetime,
                date_modified datetime,
                bIsKids boolean,
                bIsClosed boolean
                );";

                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();

                sqlite_cmd.CommandText = @"CREATE TABLE Attendence
                (
                    id integer primary key,
                    PersonID integer,
                    Date varchar(25),
                    ClassID integer
                );";
                // Now lets execute the SQL ;D
                sqlite_cmd.ExecuteNonQuery();
            }
        }
Beispiel #6
0
 private void editSetupToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form setup = new Setup1(this);
     setup.ShowDialog();
 }