private void pOToolStripMenuItem_Click(object sender, EventArgs e) { POForm poForm = new POForm(); poForm.MdiParent = this; poForm.Show(); }
private void dgSearchResult_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { string tableName = ""; int id = 0; if (comboBox1.SelectedItem != null && ((DataRowView)comboBox1.SelectedItem)["Name"].ToString() != "Please select table") { tableName = ((DataRowView)comboBox1.SelectedItem)["Name"].ToString(); DataGridViewRow dr = ((DataGridView)sender).SelectedRows[0]; id = int.Parse(dr.Cells["Id"].Value.ToString()); } if (tableName == "Supplier") { SupplierForm supplierForm = new SupplierForm(); supplierForm.MdiParent = this.MdiParent; supplierForm.Show(); supplierForm.searchById(id); } if (tableName == "Client") { ClientForm clientForm = new ClientForm(); clientForm.MdiParent = this.MdiParent; clientForm.Show(); clientForm.searchById(id); } if (tableName == "Workers") { WorkersForm workersForm = new WorkersForm(); workersForm.MdiParent = this.MdiParent; workersForm.Show(); workersForm.searchById(id); } if (tableName == "Category") { CategoryForm categoryForm = new CategoryForm(); categoryForm.MdiParent = this.MdiParent; categoryForm.Show(); categoryForm.searchById(id); } if (tableName == "PO") { POForm poForm = new POForm(); poForm.MdiParent = this.MdiParent; poForm.Show(); poForm.searchById(id); } if (tableName == "SupplierInvoice") { SupplierInvoiceForm supplierInvoiceForm = new SupplierInvoiceForm(); supplierInvoiceForm.MdiParent = this.MdiParent; supplierInvoiceForm.Show(); supplierInvoiceForm.searchById(id); } if (tableName == "Invoice") { InvoiceForm invoiceForm = new InvoiceForm(); invoiceForm.MdiParent = this.MdiParent; invoiceForm.Show(); invoiceForm.searchById(id); } if (tableName == "Project") { ProjectForm projectForm = new ProjectForm(); projectForm.MdiParent = this.MdiParent; projectForm.Show(); projectForm.searchById(id); } }