Пример #1
0
        /* Permission Group Name Reference
         * 1. Warehouse Employee
         * 2. Receiving
         * 3. Shipping
         * 4. Operations Supervisor - History
         * 5. Warehouse Manager		- History
         * 6. Administrator			- History
         */
        private void InvokeForm(string formName, string empName, int pid)
        {
            Hide();

            //Invoking Inventory Form's Constructor
            if (formName == "Warehouse Employee")
            {
                var warehouse = new Inventory(_connection, _command, empName, pid);
                warehouse.Closed += (s, args) => Close();
                warehouse.Show();
            }
            //Invoking Receiving Form's Constructor
            if (formName == "Receiving")
            {
                var receiving = new Receiving(_connection, _command, empName, pid);
                receiving.Closed += (s, args) => Close();
                receiving.Show();
            }
            //Invoking Shipping Form's Constructor
            if (formName == "Shipping")
            {
                var shipping = new Shipping(_connection, _command, empName, pid);
                shipping.Closed += (s, args) => Close();
                shipping.Show();
            }
            //Invoking Operations Supervisor Form's Constructor
            if (formName == "Operations Supervisor")
            {
                var history = new History(_connection, _command, empName, pid);
                history.Closed += (s, args) => Close();
                history.Show();
            }
            //Invoking Warehouse Manager Form's Constructor
            if (formName == "Warehouse Manager")
            {
                var history = new History(_connection, _command, empName, pid);
                history.Closed += (s, args) => Close();
                history.Show();
            }
            //Invoking Administrator Form's Constructor
            if (formName == "Administrator")
            {
                var history = new History(_connection, _command, empName, pid);
                history.Closed += (s, args) => Close();
                history.Show();
            }
        }