Пример #1
0
 public WelForm()
 {
     InitializeComponent();
     FormsData fd = new FormsData();
     labelWel.Text=fd.getWords();
     this.Refresh();
 }
Пример #2
0
        //TreeView点击函数--切换菜单
        private void myTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            FormsData fd=new FormsData();
            TreeNode node = new TreeNode();
            node = myTree.SelectedNode;
            if (node.Text == "用户操作" || node.Text == "前台服务" || node.Text == "后台管理" ){}
            else if (node.Text == "退出系统")
            {
                 sc.Close();
                Application.Exit();
            }
            else if (node.Text == "用户登录")
            {
                //用户已登录则跳转至提示界面
                if (fd.getAdminStatus())
                {
                    fd.setAdminStatus(false);
                }
                panel_Log();
            }
            else if (node.Text == "用户注册")
            {
                if (fd.getAdminStatus())
                {
                    panel_Reg();
                }
                else
                {
                    MessageBox.Show("管理员账户未登录!");
                    panel_Log();
                }
            }
            else if (node.Text == "宾客登记")
            {
                if (fd.getUserStatus()||fd.getAdminStatus())
                {
                    panel_GLog();
                }
                else
                {
                    MessageBox.Show("用户未登录!");
                    panel_Log();
                }
            }
            else if (node.Text == "宾客退房")
            {
                if (fd.getAdminStatus()||fd.getUserStatus())
                {
                    panel_GExit();
                }
                else
                {
                    MessageBox.Show("用户未登录!");
                    panel_Log();
                }

            }
            else if (node.Text == "宾客预约")
            {
                if (fd.getAdminStatus()||fd.getUserStatus())
                {
                    panel_GOrder();
                }
                else
                {
                    MessageBox.Show("用户未登录!");
                    panel_Log();
                }

            }
            else if (node.Text == "客户管理")
            {
                if (!fd.getAdminStatus())
                {
                    MessageBox.Show("需登录管理员账号!");
                    panel_Log();
                }
                else
                {
                    panel_GForm();
                }

            }
            else if (node.Text == "客房管理")
            {
                if (!fd.getAdminStatus())
                {
                    MessageBox.Show("需登录管理员账号!");
                    panel_Log();
                }
                else
                {
                    panel_RForm();
                }
            }
            else if (node.Text == "系统设置")
            {
                if (!fd.getAdminStatus())
                {
                    MessageBox.Show("需登录管理员账号!");
                    panel_Log();
                }
                else
                {
                    panel_Setting();
                }
            }
        }