private void единицыИзмеренияToolStripMenuItem_Click(object sender, EventArgs e) { UnitForm frm = new UnitForm(deletion_allowed); frm.ShowDialog(); }
private void Unit_btn_Click(object sender, EventArgs e) { UnitForm unitform = new UnitForm(); unitform.ShowDialog(); }
private void InitForm(string mode) { Form newForm; DataGridViewRow selectedRow = new DataGridViewRow(); if (mode.Equals("Edit")) { try { selectedRow = DgvGeneric.SelectedRows[0]; } catch (Exception ex) { Console.WriteLine(ex.Message); MessageBox.Show( text: "Debes seleccionar una fila", caption: "Error", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error); return; } } switch (activeGrid) { case 0: newForm = new EmployeeForm(mode, selectedRow); newForm.ShowDialog(); break; case 1: newForm = new DepartmentForm(mode, selectedRow); newForm.ShowDialog(); break; case 2: newForm = new ItemForm(mode, selectedRow); newForm.ShowDialog(); break; case 3: newForm = new BrandForm(mode, selectedRow); newForm.ShowDialog(); break; case 4: newForm = new UnitForm(mode, selectedRow); newForm.ShowDialog(); break; case 5: newForm = new ProviderForm(mode, selectedRow); newForm.ShowDialog(); break; case 6: newForm = new ItemRequestForm(mode, selectedRow); newForm.ShowDialog(); break; case 7: newForm = new PurchaseOrderForm(mode, selectedRow); newForm.ShowDialog(); break; case 8: newForm = new UserForm(mode, selectedRow); newForm.ShowDialog(); break; } }