private void OpenSelectedAutoPartDetail(int rowIndex) { int id = (int)dataGridView1.Rows[rowIndex].Cells["IdColumn"].Value; selectedId = id; if (!AllowSelect) { ViewItemForm form = new ViewItemForm(); form.AutoPartDetailId = id; form.FormClosed += new FormClosedEventHandler(form_FormClosed); form.Owner = this.ParentForm; form.Show(); } else { DataGridViewRow row = dataGridView1.Rows[rowIndex]; if (row != null) { string partNumber = row.Cells["PartNumberColumn"].Value.ToString(); int qty = (int)row.Cells["QtyColumn"].Value; SearchItemForm f = (SearchItemForm)this.ParentForm; f.PartId = id; f.Quantity = qty; f.PartNumber = partNumber; } } }
private void FindItemButton_Click(object sender, EventArgs e) { SearchItemForm form = new SearchItemForm(); form.Owner = this.ParentForm; form.ItemSelected += this.ItemSelected; form.Show(); }
private void MtlSearchItem_Click(object sender, EventArgs e) { this.Visible = false; SearchItemForm searchItemForm = new SearchItemForm(); searchItemForm.Location = this.Location; searchItemForm.ShowDialog(); this.Close(); }