private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (loginState == false)
            {
                return;
            }

            HideLoginForm();

            if (tabControl1.SelectedIndex == 0)
            {
                StaffManagement form = (StaffManagement)dictForm["staffManagementForm"];
                form.Show();
                form.Activate();
            }

            else if (tabControl1.SelectedIndex == 1)
            {
                TransactionStock form = (TransactionStock)dictForm["transactionStockForm"];
                form.Show();
                form.Activate();
            }

            else if (tabControl1.SelectedIndex == 2)
            {
                MaterialOrderManagement form = (MaterialOrderManagement)dictForm["materialOrderForm"];
                form.Show();
                form.Activate();
            }


            else if (tabControl1.SelectedIndex == 3)
            {
                WarehouseManagement form = (WarehouseManagement)dictForm["warehouseManagementForm"];
                form.Show();
                form.Activate();
            }

            else if (tabControl1.SelectedIndex == 4)
            {
                ResourceQuoteForm form = (ResourceQuoteForm)dictForm["resourceQuoteForm"];
                form.Show();
                form.Activate();
                form.DisplayQuote();
            }
            else
            {
                TransactionStock form = (TransactionStock)dictForm["transactionStockForm"];
            }
        }
Exemple #2
0
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (loginState == false)
            {
                return;
            }

            HideLoginForm();

            if (tabControl1.SelectedIndex == 0)
            {
                //for (int i = 0; i < dictForm.Count; i++)
                //{
                //    Form[] forms = this.MdiChildren;
                //    foreach (var item in forms)
                //    {
                //        ((Form)item).Hide();
                //    }
                //}
                StaffManagement form = (StaffManagement)dictForm["staffManagementForm"];
                form.Show();
                form.Activate();
            }

            else if (tabControl1.SelectedIndex == 1)
            {
                //for (int i = 0; i < dictForm.Count; i++)
                //{
                //    Form[] forms = this.MdiChildren;
                //    foreach (var item in forms)
                //    {
                //        ((Form)item).Hide();
                //    }
                //}
                TransactionStock form = (TransactionStock)dictForm["transactionStockForm"];
                form.Show();
                form.Activate();
            }

            else if (tabControl1.SelectedIndex == 2)
            {
                //for (int i = 0; i < dictForm.Count; i++)
                //{
                //    Form[] forms = this.MdiChildren;
                //    foreach (var item in forms)
                //    {
                //        ((Form)item).Hide();
                //    }
                //}
                MaterialOrderManagement form = (MaterialOrderManagement)dictForm["materialOrderForm"];
                form.Show();
                form.Activate();
            }


            else if (tabControl1.SelectedIndex == 3)
            {
                //for (int i = 0; i < dictForm.Count; i++)
                //{
                //    Form[] forms = this.MdiChildren;
                //    foreach (var item in forms)
                //    {
                //        ((Form)item).Hide();
                //    }
                //}
                WarehouseManagement form = (WarehouseManagement)dictForm["warehouseManagementForm"];
                form.Show();
                form.Activate();
            }

            else if (tabControl1.SelectedIndex == 4)
            {
                //for(int i=0; i<dictForm.Count; i++)
                //{
                //    Form[] forms = this.MdiChildren;
                //    foreach (var item in forms)
                //    {
                //        ((Form)item).Hide();
                //    }
                //}
                ResourceQuoteForm form = (ResourceQuoteForm)dictForm["resourceQuoteForm"];
                form.Show();
                form.Activate();
                form.DisplayQuote();
            }
            else
            {
                TransactionStock form = (TransactionStock)dictForm["transactionStockForm"];
                //form.Hide();
            }
        }