Exemplo n.º 1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
            TreeNode node = treeView1.SelectedNode;

            if (node.Text == "Manage User")
            {
                UserForm usersetup = new UserForm();
                usersetup.MdiParent = this;
                usersetup.Dock = DockStyle.Fill;
                usersetup.Show();
            }
            if (node.Text == "Manage Inventory")
            {
                InventoryForm inventory = new InventoryForm();
                inventory.MdiParent = this;
                inventory.Dock = DockStyle.Fill;
                inventory.Show();
            }
            if (node.Text == "Employee Details")
            {
                EmployeeForm employee = new EmployeeForm();
                employee.MdiParent = this;
                employee.Dock = DockStyle.Fill;
                employee.Show();
            }
            if (node.Text == "Transaction")
                {
                    TransactionForm transac = new TransactionForm();
                    transac.MdiParent = this;
                    transac.Dock = DockStyle.Fill;
                    transac.Show();
                }
                if (node.Text == "Designation")
                {
                    DesignationForm desig = new DesignationForm();
                    desig.MdiParent = this;
                    desig.Dock = DockStyle.Fill;
                    desig.Show();
                }
                if (node.Text == "Generate Reports")
                {
                    ReportForm report = new ReportForm();
                    report.MdiParent = this;
                    report.Dock = DockStyle.Fill;
                    report.Show();
                }
        }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }                     
        }
Exemplo n.º 2
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
                TreeNode node = treeView1.SelectedNode;

                if (node.Text == "Manage User")
                {
                    UserForm usersetup = new UserForm();
                    usersetup.MdiParent = this;
                    usersetup.Dock      = DockStyle.Fill;
                    usersetup.Show();
                }
                if (node.Text == "Manage Items")
                {
                    ItemsForm inventory = new ItemsForm();
                    inventory.MdiParent = this;
                    inventory.Dock      = DockStyle.Fill;
                    inventory.Show();
                }
                if (node.Text == "Employee Details")
                {
                    EmployeeForm employee = new EmployeeForm();
                    employee.MdiParent = this;
                    employee.Dock      = DockStyle.Fill;
                    employee.Show();
                }
                if (node.Text == "Transaction")
                {
                    TransactionForm transac = new TransactionForm();
                    transac.MdiParent = this;
                    transac.Dock      = DockStyle.Fill;
                    transac.Show();
                }
                if (node.Text == "Designation")
                {
                    DesignationForm desig = new DesignationForm();
                    desig.MdiParent = this;
                    desig.Dock      = DockStyle.Fill;
                    desig.Show();
                }
                if (node.Text == "Generate Reports")
                {
                    ReportForm report = new ReportForm();
                    report.MdiParent = this;
                    report.Dock      = DockStyle.Fill;
                    report.Show();
                }
                if (node.Text == "Trash")
                {
                    TrashForm trash = new TrashForm();
                    trash.MdiParent = this;
                    trash.Dock      = DockStyle.Fill;
                    trash.Show();
                }
            }
            catch (Exception ex)
            {
                MetroMessageBox.Show(this, ex.Message);
            }
        }