private void metroAddHumanStructButton_Click(object sender, EventArgs e)
        {
            HumanStruct currentHumanStruct = new HumanStruct();

            using (var unitOfWork = new UnitOWork(new GoDBContext()))
            {
                if (this.Controls.OfType <MetroTextBox>().All(textBox => textBox.Text != String.Empty))
                {
                    currentHumanStruct.id = Int32.Parse(metroHumanStructIdTextBox.Text);
                    currentHumanStruct.DB_Object_Symbol = metroGeneSymbolTextBox.Text;
                    currentHumanStruct.GOid             = Int32.Parse(metroHumanStructGoIdTextBox.Text);
                    Confirm confirm = new Confirm();
                    confirm.ShowDialog();
                    if (confirm.Result)
                    {
                        unitOfWork.HumanStructs.Add(currentHumanStruct);
                        unitOfWork.Complete();
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show(@"Invalid input values");
                }
            }
        }
Example #2
0
        private void metroAddGoTermButton_Click(object sender, EventArgs e)
        {
            GoTerm currentGoTerm = new GoTerm();

            using (var unitOfWork = new UnitOWork(new GoDBContext()))
            {
                if (this.Controls.OfType <MetroTextBox>().All(textBox => textBox.Text != String.Empty))
                {
                    currentGoTerm.GO_ID         = Int32.Parse(metroGoIdTextBox.Text);
                    currentGoTerm.name          = metroNameTextBox.Text;
                    currentGoTerm.Go_definition = metroDefinitionTextBox.Text;
                    currentGoTerm.ontology      = metroOntologyTextBox.Text;
                    Confirm confirm = new Confirm();
                    confirm.ShowDialog();
                    if (confirm.Result)
                    {
                        unitOfWork.GoTerms.Add(currentGoTerm);
                        unitOfWork.Complete();
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show(@"Invalid input values");
                }
            }
        }