Ejemplo n.º 1
0
        public void btnVisualTest_Click(object sender, EventArgs e)
        {
            toGlobal fileStuff = new toGlobal();
            //`fileStuff.ee();

            SQLfx Data = new SQLfx();

            SqlConnection con = Data.openSQLConnection(); // Open SQL Connection
            SqlCommand    cmd = new SqlCommand();

            // cmd.Connection = con;

            SqlDataAdapter sqlDa = new SqlDataAdapter("SELECT * FROM trialList", con);
            DataTable      dtbl  = new DataTable();

            sqlDa.Fill(dtbl);

            dataGridView1.DataSource = dtbl;
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            updateDataTable();
            toGlobal      tG         = new toGlobal();
            StringBuilder output     = new StringBuilder();
            int           numEntries = 0;

            if (!tG.checkEmptyTable("condPresets"))
            {
                SQLfx          Data = new SQLfx();
                SqlConnection  con  = Data.openSQLConnection(); // Open SQL Connection
                SqlCommand     cmd  = new SqlCommand("SELECT condLabel FROM condPresets", con);
                SqlDataAdapter da   = new SqlDataAdapter(cmd);
                DataTable      dt   = new DataTable();
                da.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    foreach (DataColumn col in dt.Columns)
                    {
                        output.AppendFormat("{0},", dr[col]);
                    }
                    numEntries++;
                    output.AppendLine();
                }
                if (numEntries == 0)
                {
                    return;
                }
            }


            foreach (string s in output.Replace("\n", "").Replace("\r", "").ToString().Split(',').Distinct())
            {
                Console.WriteLine(s);
                if (s.Length > 0)
                {
                    cbPreset.Items.Add(s);
                }
            }
        }
Ejemplo n.º 3
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            SQLfx Data = new SQLfx();

            SqlConnection con = Data.openSQLConnection(); // Open SQL Connection
            SqlCommand    cmd = new SqlCommand();

            cmd.Connection  = con;
            cmd.CommandText = "INSERT INTO properties (DCP, NMD, RSD, RND, FCA, PCA, MPA, IST) VALUES (@DCP, @NMD, @RSD, @RND, @FCA, @PCA, @MPA, @IST);";
            cmd.Parameters.AddWithValue("@DCP", Convert.ToString(txtDataCollectionPeriod.Text));
            cmd.Parameters.AddWithValue("@NMD", txtNearMissDistance.Text);
            cmd.Parameters.AddWithValue("@RSD", txtRespawnStartDistance.Text);
            cmd.Parameters.AddWithValue("@RND", txtRespawnEndDistance.Text);
            cmd.Parameters.AddWithValue("@FCA", txtFullCheckAngle.Text);
            cmd.Parameters.AddWithValue("@PCA", txtPartialCheckAngle.Text);
            cmd.Parameters.AddWithValue("@MPA", txtMaxPitchAngle.Text);
            cmd.Parameters.AddWithValue("@IST", iST.Text);
            cmd.ExecuteNonQuery();

            toGlobal fileStuff = new toGlobal();

            if (txtID.Text.Length == 0)
            {
                txtID.Text = "ID";
            }
            fileStuff.ee(txtID.Text, txtAge.Text, Sex.Text, txtHeight.Text, txtPath.Text, textBox7.Text);
            cmd.ExecuteNonQuery();
            String query = "DELETE FROM dbo.properties";

            cmd = new SqlCommand(query, con);
            cmd.ExecuteNonQuery();

            Process.Start(@"C:\vr\vr3\main.py");

            //txtID.Text = "";
        }