Esempio n. 1
0
        private void единицыИзмеренияToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UnitForm frm = new UnitForm(deletion_allowed);

            frm.ShowDialog();
        }
Esempio n. 2
0
        private void Unit_btn_Click(object sender, EventArgs e)
        {
            UnitForm unitform = new  UnitForm();

            unitform.ShowDialog();
        }
Esempio n. 3
0
        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;
            }
        }