Beispiel #1
0
        public void LoadScreen()
        {
            //TreeMain
            //ucTreeMain = new UcTreeMain();
            //ucTreeMain.LoadControl(this.iModule_ID);
            //ucTreeMain.Dock = DockStyle.Top;
            //ucTreeMain.Width = pnlLeftScreen.Width - 20;
            //ucTreeMain.MinimumSize = new Size(ucTreeMain.Width, pnlLeftScreen.Height / 3);
            //ucTreeMain.MaximumSize = new Size(ucTreeMain.Width, pnlLeftScreen.Height * 6 / 6);
            //ucTreeMain.SetProperlyHeight();
            //ucTreeMain.Visible = false;
            //pnlLeftScreen.Controls.Add(ucTreeMain);

            ucNarvarMain = new ucNarMain();
            ucNarvarMain.LoadControl();
            ucNarvarMain.Anchor = AnchorStyles.Top | AnchorStyles.Left;


            //ucNarvarMain.Width = pnlLeftScreen.Width;
            //pnlLeftScreen.Controls.Add(ucNarvarMain);
            //this.pnlLeftScreen.Visible = false;

            /////////////////////////
            pnlScreen.Dock = DockStyle.Fill;

            this.pnlCenter.Dock    = DockStyle.Fill;
            this.ucNarvarMain.Dock = DockStyle.Left;

            pnlScreen.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
                                                 | AnchorStyles.Left)
                                                | AnchorStyles.Right)));

            ////////////////////////
            tbTabPageControl tbTabPageMain = new tbTabPageControl();

            tbTabPageMain.Tag = "MAIN";

            pnImage = new pnlControl();
            if (Element.sysLanguage == enuLanguageType.Vietnamese)
            {
                pnImage.BackgroundImage = Commons.Properties.Resources.Background_V;
            }
            else
            {
                pnImage.BackgroundImage = Commons.Properties.Resources.Background_E;
            }
            pnImage.BackgroundImageLayout = ImageLayout.Stretch;
            pnImage.Dock = DockStyle.Fill;


            this.tbTabMain.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
                                                      | AnchorStyles.Left)
                                                     | AnchorStyles.Right)));

            tbTabMain.Dock    = DockStyle.Fill;
            tbTabMain.Visible = false;


            pnlScreen.Dock = DockStyle.Fill;

            this.pnlScreen.Controls.Add(ucNarvarMain);

            this.pnlCenter.Controls.Add(tbTabMain);
            this.pnlCenter.Controls.Add(pnImage);

            this.ssMain.Dock = DockStyle.Bottom;
            this.pnlCenter.Controls.Add(ssMain);

            /*
             *
             *          //ModuleManagement Nhac viec
             *          //ucModuleManagement.Dock = DockStyle.Bottom;
             *          //ucModuleManagement.Width = pnlLeftScreen.Width - 20;
             *
             *          //    pnlLeftScreen.Controls.Add(ucModuleManagement);
             *
             *          //ucModuleManagement.Width = 250;
             *          //ucModuleManagement.Anchor = AnchorStyles.Top | AnchorStyles.Right;
             *          //if (iModule_ID <= 0)
             *          //{
             *          //    this.pnlCenter.Controls.Add(ucModuleManagement);
             *          //    //ucModuleManagement.Location = new Point(this.pnlCenter.Width - ucModuleManagement.Width - 1, 1);
             *          //    ucModuleManagement.Location = new Point(this.pnlCenter.Width - ucModuleManagement.Width - 1, this.pnlCenter.Height - ucModuleManagement.Height - 20);
             *          //    ucModuleManagement.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
             *          //}
             *
             *          //Cac control khac
             *
             *          //ucCustomer = new ucCustomerInfo();
             *          //this.pnlCenter.Controls.Add(ucCustomer);
             *
             *          //tbTabPageMain.Controls.Add(ucCustomer);
             *          //ucCustomer.Location = new Point(0, 0);
             *          //ucCustomer.Anchor = AnchorStyles.Top | AnchorStyles.Left;
             */
        }
Beispiel #2
0
        public void LoadScreen()
        {
            //TreeMain
            //ucTreeMain = new UcTreeMain();
            //ucTreeMain.LoadControl(this.iModule_ID);
            //ucTreeMain.Dock = DockStyle.Top;
            //ucTreeMain.Width = pnlLeftScreen.Width - 20;
            //ucTreeMain.MinimumSize = new Size(ucTreeMain.Width, pnlLeftScreen.Height / 3);
            //ucTreeMain.MaximumSize = new Size(ucTreeMain.Width, pnlLeftScreen.Height * 6 / 6);
            //ucTreeMain.SetProperlyHeight();
            //ucTreeMain.Visible = false;
            //pnlLeftScreen.Controls.Add(ucTreeMain);

            ucNarvarMain = new ucNarMain();
            ucNarvarMain.LoadControl();
            ucNarvarMain.Anchor = AnchorStyles.Top | AnchorStyles.Left;
            ucNarvarMain.SetProperlyHeight(this);

            //ucNarvarMain.Width = pnlLeftScreen.Width;
            //pnlLeftScreen.Controls.Add(ucNarvarMain);
            //this.pnlLeftScreen.Visible = false;

            /////////////////////////
            pnlScreen.Dock = DockStyle.Fill;

            this.pnlCenter.Dock    = DockStyle.Fill;
            this.ucNarvarMain.Dock = DockStyle.Left;

            pnlScreen.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
                                                 | AnchorStyles.Left)
                                                | AnchorStyles.Right)));

            ////////////////////////
            tbTabPageControl tbTabPageMain = new tbTabPageControl();

            tbTabPageMain.Tag = "MAIN";

            //this.pnImage = new pnlControl();
            //if (Element.sysLanguage == enuLanguageType.Vietnamese)
            //    pnImage.BackgroundImage = Commons.Properties.Resources.Background_V;
            //else
            //    pnImage.BackgroundImage = Commons.Properties.Resources.Background_E;
            this.pnImage = new pnlControl();
            if (Element.sysLanguage == enuLanguageType.Vietnamese)
            {
                this.pnImage.BackgroundImage = Commons.Properties.Resources.Background_V;
                if (File.Exists(Application.StartupPath + @"\Images\Background_V.png"))
                {
                    this.pnImage.BackgroundImage = Image.FromFile(Application.StartupPath + @"\Images\Background_V.png");
                }
            }
            else if (Element.sysLanguage == enuLanguageType.English)
            {
                this.pnImage.BackgroundImage = Commons.Properties.Resources.Background_E;
                if (File.Exists(Application.StartupPath + @"\Images\Background_E.png"))
                {
                    this.pnImage.BackgroundImage = Image.FromFile(Application.StartupPath + @"\Images\Background_E.png");
                }
            }
            else
            {
                this.pnImage.BackgroundImage = Commons.Properties.Resources.Background_E;
                if (File.Exists(Application.StartupPath + @"\Images\Background_O.png"))
                {
                    this.pnImage.BackgroundImage = Image.FromFile(Application.StartupPath + @"\Images\Background_O.png");
                }
            }
            pnImage.BackgroundImageLayout = ImageLayout.Stretch;
            pnImage.Dock = DockStyle.Fill;
            //Add chart on the main
            #region Chart
            bool bloadChart = DataTool.SQLCheckExist("sys.procedures", "Name", "SYS_LoadMainChart");
            if (bloadChart) //Collection.Parameters.ContainsKey("MAINCHART")
            {
                DataSet dsChart = SQLExec.ExecuteReturnDs("SYS_LoadMainChart @Ma_Dvcs ='" + Element.sysMa_DvCs + "',@Nam = " + Element.sysWorkingYear.ToString() + "");
                //DataSet dsChart = SQLExec.ExecuteReturnDs("SYS_LoadMainChart");
                this.mainchart = new MainChart();
                mainchart.LoadChart(dsChart);
                mainchart.Dock = DockStyle.Fill;
                this.pnImage.Controls.Add(mainchart);
            }
            #endregion


            this.tbTabMain.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
                                                      | AnchorStyles.Left)
                                                     | AnchorStyles.Right)));

            tbTabMain.Dock    = DockStyle.Fill;
            tbTabMain.Visible = false;


            pnlScreen.Dock = DockStyle.Fill;

            this.pnlScreen.Controls.Add(ucNarvarMain);

            this.pnlCenter.Controls.Add(tbTabMain);
            this.pnlCenter.Controls.Add(pnImage);

            this.ssMain.Dock = DockStyle.Bottom;
            this.pnlCenter.Controls.Add(ssMain);



            //ModuleManagement Nhac viet

            this.ucModuleManagement.Dock  = DockStyle.Bottom;
            this.ucModuleManagement.Width = pnlLeftScreen.Width - 20;
            this.UcModuleHeight           = this.ucModuleManagement.Height;
            //this.ucModuleManagement.Height = this.UcModuleHeight - this.ucModuleManagement.lvReminder.Height;

            this.pnImage.Controls.Add(ucModuleManagement);

            //ucCustomer = new ucCustomerInfo();
            //ucCustomer.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
            //ucCustomer.Location = new Point(this.pnImage.Width / 2 + 200, this.pnImage.Height / 2);
            //this.pnImage.Controls.Add(ucCustomer);

            //ucModuleManagement.Width = 250;
            //ucModuleManagement.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;

            //ucModuleManagement.Location = new Point(this.pnlCenter.Width - ucModuleManagement.Width - 1, 1);
            //ucModuleManagement.Location = new Point(this.pnlCenter.Width - ucModuleManagement.Width - 1, this.pnlCenter.Height - ucModuleManagement.Height - 20);
            //ucModuleManagement.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;

            /*
             *
             *          //ModuleManagement Nhac viet
             *          //ucModuleManagement.Dock = DockStyle.Bottom;
             *          //ucModuleManagement.Width = pnlLeftScreen.Width - 20;
             *
             *          //    pnlLeftScreen.Controls.Add(ucModuleManagement);
             *
             *          //ucModuleManagement.Width = 250;
             *          //ucModuleManagement.Anchor = AnchorStyles.Top | AnchorStyles.Right;
             *          //if (iModule_ID <= 0)
             *          //{
             *          //    this.pnlCenter.Controls.Add(ucModuleManagement);
             *          //    //ucModuleManagement.Location = new Point(this.pnlCenter.Width - ucModuleManagement.Width - 1, 1);
             *          //    ucModuleManagement.Location = new Point(this.pnlCenter.Width - ucModuleManagement.Width - 1, this.pnlCenter.Height - ucModuleManagement.Height - 20);
             *          //    ucModuleManagement.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
             *          //}
             *
             *          //Cac control khac
             *
             *          //ucCustomer = new ucCustomerInfo();
             *          //this.pnlCenter.Controls.Add(ucCustomer);
             *
             *          //tbTabPageMain.Controls.Add(ucCustomer);
             *          //ucCustomer.Location = new Point(0, 0);
             *          //ucCustomer.Anchor = AnchorStyles.Top | AnchorStyles.Left;
             */

            //Test
            //ucWTable ucDesk = new ucWTable();
            //ucDesk.Load();
            //ucDesk.Dock = DockStyle.Fill;
            //pnImage.Controls.Add(ucDesk);

            //
        }