private void button3_Click(object sender, EventArgs e) { string aux = ""; if (listView1.SelectedIndices.Count > 0) { aux = listView1.Items[listView1.SelectedIndices[0]].Text; } if (aux != "") { foreach (Reaction reaction in mysbml.ListReaction) { if (reaction.Id.ToLower() == aux) { reaction.LowerBound = double.Parse(lbtext.Text, CultureInfo.InvariantCulture.NumberFormat); reaction.UpperBound = double.Parse(ubtext.Text, CultureInfo.InvariantCulture.NumberFormat); if (!Principal.txt) { Read read = new Read(); read.ActualizarRestricciones(Principal.doc, aux, lbtext.Text, ubtext.Text); } Principal.mysbml = mysbml; MessageBox.Show("Update!!!!!!", "Ok", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } } } else { MessageBox.Show("Select the reaction to be configured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button3_Click(object sender, EventArgs e) { int i = 0; Read red = new Read(); foreach (Reaction item in sbml.ListReaction) { item.LowerBound = double.Parse(dataGridView1.Rows[i].Cells[2].Value.ToString(), CultureInfo.InvariantCulture.NumberFormat); item.UpperBound = double.Parse(dataGridView1.Rows[i].Cells[3].Value.ToString(), CultureInfo.InvariantCulture.NumberFormat); if (!Principal.txt) { red.ActualizarRestricciones(Principal.doc, item.Id, dataGridView1.Rows[i].Cells[2].Value.ToString(), dataGridView1.Rows[i].Cells[3].Value.ToString()); } i++; } Principal.mysbml = sbml; MessageBox.Show("Update!!!!!!", "Ok", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void updateButton_Click(object sender, EventArgs e) { if (comboconstrain.Text.Length > 0) { if (Sbml.There(comboconstrain, comboconstrain.Text)) { if (isReversibleTextBox.Text == "False") { if (double.Parse(lowertextBox1.Text, CultureInfo.InvariantCulture.NumberFormat) < 0) { MessageBox.Show("This reaction is irreversible, the Lower Bound must be less than zero", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { foreach (Reaction item in sbml.ListReaction) { if (item.Id == comboconstrain.Text) { item.LowerBound = double.Parse(lowertextBox1.Text, CultureInfo.InvariantCulture.NumberFormat); item.UpperBound = double.Parse(uppertextBox2.Text, CultureInfo.InvariantCulture.NumberFormat); Principal.mysbml = sbml; if (!Principal.txt) { Read red = new Read(); red.ActualizarRestricciones(Principal.doc, comboconstrain.Text.ToLower(), lowertextBox1.Text, uppertextBox2.Text); } MessageBox.Show("Update!!!!!!", "Ok", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } } } } else { foreach (Reaction item in sbml.ListReaction) { if (item.Id == comboconstrain.Text) { item.LowerBound = double.Parse(lowertextBox1.Text, CultureInfo.InvariantCulture.NumberFormat); item.UpperBound = double.Parse(uppertextBox2.Text, CultureInfo.InvariantCulture.NumberFormat); Principal.mysbml = sbml; if (!Principal.txt) { Read red = new Read(); red.ActualizarRestricciones(Principal.doc, comboconstrain.Text.ToLower(), lowertextBox1.Text, uppertextBox2.Text); } MessageBox.Show("Update!!!!!!", "Ok", MessageBoxButtons.OK, MessageBoxIcon.Information); break; } } } } else { MessageBox.Show("Not exist a reaction with this name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Select the reaction to be configured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }