Example #1
0
        void DisplayPanel(object _child)
        {
            if (!_child.ToString().Equals(panelMain.Name))
            {
                foreach (UserControl c in panelMain.Controls)
                {
                    ((IFormPanelChild)c).Hide();
                }
                if (_child.ToString().Equals(typeof(PanelListPatient).Name))
                {
                    panelListPatient.RefeshDataTable(null);
                    panelListPatient.Show();
                    lblNaviBar2.Visible = true;
                    lblNaviBar2.Text    = "Danh sách";
                }
                else
                {
                    if (_child.ToString().Equals(typeof(PanelHome).Name))
                    {
                        panelHome.Show();
                        lblNaviBar2.Visible = false;
                        lblNaviBar2.Text    = "Empty";
                    }
                    else
                    {
                        if (_child.ToString().Equals("Backup"))
                        {
                            PanelFunction panelFunction = new PanelFunction();
                            panelFunction.Dock = DockStyle.Fill;
                            panelMain.Controls.Add(panelFunction);
                            panelFunction.Show();
                            lblNaviBar2.Visible = true;
                            lblNaviBar2.Text    = "Backup";
                        }
                        else
                        {
                            this.Hide();
                            Form    aboutForm = new Form();
                            AboutMe aboutMe   = new AboutMe();
                            aboutMe.Dock              = DockStyle.Fill;
                            aboutForm.Size            = aboutMe.Size;
                            aboutForm.WindowState     = FormWindowState.Normal;
                            aboutForm.StartPosition   = FormStartPosition.CenterScreen;
                            aboutForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                            aboutForm.Controls.Add(aboutMe);
                            aboutForm.ShowDialog();
                            this.Show();

                            panelHome.Show();
                            lblNaviBar2.Visible = false;
                            lblNaviBar2.Text    = "Empty";
                            panelMain.Name      = typeof(PanelHome).Name;
                            return;
                        }
                    }
                }
                panelMain.Name = _child.ToString();
            }
        }
 void DisplayPanel(object _child)
 {
     if (_child != null && _child is tb_person)
     {
         panelHome.Show();
         panelListPatient.Hide();
         panelMain.Name = typeof(PanelHome).Name;
         tb_person person = (tb_person)_child;
         panelHome.Person    = person;
         lblNaviBar2.Visible = true;
         lblNaviBar2.Text    = person.FullName;
     }
     else
     {
         if (_child != null && _child is string)
         {
             foreach (UserControl c in panelMain.Controls)
             {
                 ((IFormPanelChild)c).Hide();
             }
             if (_child.ToString().Equals(typeof(PanelListPatient).Name))
             {
                 panelListPatient.RefeshDataTable(null);
                 panelListPatient.Show();
                 lblNaviBar2.Visible = false;
                 lblNaviBar2.Text    = "Empty";
             }
         }
     }
 }
Example #3
0
        /**
         * Properties
         **/

        public FormMain()
        {
            InitializeComponent();
            this.lblNaviBar1.Image = UtilImage.ResizeImage(global::ManagerPartient.Properties.Resources.button_menu_2, 120, 34);
            this.lblNaviBar2.Image = UtilImage.ResizeImage(global::ManagerPartient.Properties.Resources.button_menu_1, 120, 34);
            this.lblNaviBar3.Image = UtilImage.ResizeImage(global::ManagerPartient.Properties.Resources.button_menu_1, 120, 34);

            panelHome        = new PanelHome();
            panelListPatient = new PanelListPatient();

            panelHome.DisplayPanelEvent        += new DisplayPanelHander(DisplayPanel);
            panelListPatient.DisplayPanelEvent += new DisplayPanelHander(DisplayPanel);

            panelMain.SuspendLayout();
            panelMain.Controls.Add(panelHome);
            panelMain.Controls.Add(panelListPatient);
            panelMain.ResumeLayout();

            panelHome.Show();
            panelListPatient.Hide();

            panelMain.Name = typeof(PanelHome).Name;
        }