private void uploadButton_Click(object sender, EventArgs e) { var boardId = textBox2.Text; char groupId = Convert.ToChar(textBox1.Text); var cap = getCap(); /* Grab data from spreadsheet and place in lists */ for (int i = 0; i < 100; i++) { var onTime = Convert.ToSingle(dataGridView1.Rows[i].Cells[1].Value); var res = new EET321_Lab6DataContext(); var data = new Table_1(); data.GroupID = groupId; data.BoardID = boardId; data.DateTime = DateTime.Now; data.OnTime = onTime; data.Step = i; data.Capacitance = cap; res.Table_1s.InsertOnSubmit(data); //insert data to server res.SubmitChanges(); //submit changes } System.Windows.Forms.MessageBox.Show("Upload complete!"); }
private void uploadResistanceButton_Click(object sender, EventArgs e) { var boardId = textBox2.Text; char groupId = Convert.ToChar(textBox1.Text); /* Grab data from spreadsheet and place in lists */ for (int i = 0; i < 100; i++) { var resistance = Convert.ToSingle(dataGridView2.Rows[i].Cells[0].Value); var res = new EET321_Lab6DataContext(); var data = new Table_Resistance(); data.GroupID = groupId; data.BoardID = boardId; data.DateTime = DateTime.Now; data.Resistance = resistance; res.Table_Resistances.InsertOnSubmit(data); res.SubmitChanges(); //submit changes Thread.Sleep(100); //wait .1 sec } System.Windows.Forms.MessageBox.Show("Upload complete!"); //Message upload complete }
private void uploadManual_Click(object sender, EventArgs e) { var boardId = textBox2.Text; char groupId = Convert.ToChar(textBox1.Text); var res = new EET321_Lab6DataContext(); var data = new Table2(); data.GroupID = groupId; data.BoardID = boardId; data.DateTime = DateTime.Now; data.MeasMaxOnTime = Convert.ToSingle(textBox6.Text); data.MeasMinOnTime = Convert.ToSingle(textBox4.Text); data.MeasureMaxResistance = Convert.ToSingle(textBox5.Text); data.MeasureMinResistance = Convert.ToSingle(textBox3.Text); res.Table2s.InsertOnSubmit(data); res.SubmitChanges(); //submit changes System.Windows.Forms.MessageBox.Show("Upload complete!"); }
private void uploadResistanceButton_Click(object sender, EventArgs e) { var boardId = textBox2.Text; char groupId = Convert.ToChar(textBox1.Text); /* Grab data from spreadsheet and place in lists */ for (int i = 0; i < 100; i++) { var resistance = Convert.ToSingle(dataGridView2.Rows[i].Cells[0].Value); var res = new EET321_Lab6DataContext(); var data = new Table_Resistance(); data.GroupID = groupId; data.BoardID = boardId; data.DateTime = DateTime.Now; data.Resistance = resistance; res.Table_Resistances.InsertOnSubmit(data); res.SubmitChanges(); //submit changes } System.Windows.Forms.MessageBox.Show("Upload complete!"); }
private void uploadButton_Click(object sender, EventArgs e) { var boardId = textBox2.Text; //set board ID char groupId = Convert.ToChar(textBox1.Text); //set group ID var cap = getCap(); //get cap value /* Grab data from spreadsheet and place in lists */ for (int i = 0; i < 100; i++) { var onTime = Convert.ToSingle(dataGridView1.Rows[i].Cells[1].Value); //get onTime from grid var res = new EET321_Lab6DataContext(); var data = new Table_1(); //Get proper information to get sent to server data.GroupID = groupId; data.BoardID = boardId; data.DateTime = DateTime.Now; data.OnTime = onTime; data.Step = i; data.Capacitance = cap; res.Table_1s.InsertOnSubmit(data);//insert data to server res.SubmitChanges(); //submit changes Thread.Sleep(100); //wait .1 sec } System.Windows.Forms.MessageBox.Show("Upload complete!"); //Message uplaod complete }