private void metroSearchRelationsButton_Click(object sender, EventArgs e) { if (metroGoTermsGrid.CurrentCell == null) { MessageBox.Show(@"Choose the term!"); } else { using (var unitOfWork = new UnitOWork(new GoDBContext())) { foreach (DataGridViewRow row in metroGoTermsGrid.Rows) { if (row.Selected) { var goTerms = unitOfWork.GoTerms. GetById(Int32.Parse(row.Cells[0].Value.ToString())); MetroTextBox txt = new MetroTextBox(); txt.Text = row.Cells[0].Value.ToString(); metroGoDBTabControl.SelectedTab = metroGoDBTabControl. TabPages["metroRelationsTabPage"]; SearchRelations(metroIsAGrid, txt); SearchRelations(metroPartOfGrid, txt); } } } } }
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"); } } }
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"); } } }
public void LoadIsAGridEvent(object sender, EventArgs e) { using (var unitOfWork = new UnitOWork(new GoDBContext())) { var isAs = unitOfWork.IsAs.GetTopIsAs(TERMS_AMOUNT); foreach (var isA in isAs) { metroIsAGrid.Rows.Add(isA.id_term, isA.GOid); } } }
public void LoadPartOfGridEvent(object sender, EventArgs e) { using (var unitOfWork = new UnitOWork(new GoDBContext())) { var partOfs = unitOfWork.PartOfs.GetTopPartOfs(TERMS_AMOUNT); foreach (var partOf in partOfs) { metroPartOfGrid.Rows.Add(partOf.id_term, partOf.GOid); } } }
/// <summary> /// Shows Human Structs in the grid. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void LoadHumanStructGridEvent(object sender, EventArgs e) { using (var unitOfWork = new UnitOWork(new GoDBContext())) { var humanStructs = unitOfWork.HumanStructs.GetTopHumanStruct(TERMS_AMOUNT); metroHumanStructGrid.Rows.AddRange(); foreach (var humanStruct in humanStructs) { metroHumanStructGrid.Rows.Add(humanStruct.id, humanStruct.DB_Object_Symbol, humanStruct.GOid); } } }
/// <summary> /// Shows GoTerms in the grid. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void LoadGoTermGridEvent(object sender, EventArgs e) { using (var unitOfWork = new UnitOWork(new GoDBContext())) { var goTerms = unitOfWork.GoTerms.GetTopTerms(TERMS_AMOUNT); foreach (var goTerm in goTerms) { metroGoTermsGrid.Rows.Add(goTerm.GO_ID, goTerm.name, goTerm.Go_definition, goTerm.ontology); } } }
static void Main(string[] args) { using (var unitOfWork = new UnitOWork(new GoDBContext())) { var goTerm = unitOfWork.GoTerms.Get(1); Console.WriteLine(goTerm.GO_ID); /// var goTerms = unitOfWork.GoTerms.GetTopTerms(10); foreach (var term in goTerms) { Console.WriteLine(term.GO_ID); } } }
public void LoadGoTermVsGeneSymbolGridEvent(object sender, EventArgs e) { using (var unitOfWork = new UnitOWork(new GoDBContext())) { var humanStructs = unitOfWork.HumanStructs.GetTopHumanStruct(TERMS_AMOUNT); foreach (var humanStruct in humanStructs) { var goTerms = unitOfWork.GoTerms.GetById(humanStruct.GOid); foreach (var goTerm in goTerms) { metroGeneSymbolsGrid.Rows.Add(goTerm.GO_ID, humanStruct.DB_Object_Symbol, goTerm.name, goTerm.Go_definition); } } } }