示例#1
0
        public void RunMethodFormBase()
        {
            if (this.NarMain.SelectedLink == null)
            {
                return;
            }

            if (this.NarMain.SelectedLink.Item.Tag == "")
            {
                return;
            }

            int iID = int.Parse(this.NarMain.SelectedLink.ItemName);

            NarvarItemControl tbCtrl = (NarvarItemControl)this.NarMain.SelectedLink.Item;

            frmMain frmM = (frmMain)this.FindForm();



            tsmiControl  tsmi      = Common.FindTsmi(frmM.msMainSys, iID);
            tbTabControl tbTabMain = frmM.tbTabMain;

            if (tsmi != null)
            {
                tbTabPageControl tbTabPage = new tbTabPageControl();
                tbTabPage.Name = "tabPage" + iID.ToString();

                for (int i = 0; i < tbTabMain.TabPages.Count; i++)
                {
                    if (tbTabPage.Name == tbTabMain.TabPages[i].Name)
                    {
                        tbTabMain.SelectedTabPage = tbTabMain.TabPages[i];
                        return;
                    }
                }

                frmBase obj = (frmBase)Common.RunMethodTabFormBase(tsmi);

                if (Common.InlistLike(obj.Text, "frm"))
                {
                    frmView fv = new frmView();
                    try
                    {
                        fv           = (frmView)obj;
                        fv.Object_ID = tbCtrl.strObject_ID;
                    }
                    catch { }

                    if (!fv.isView)
                    {
                        return;
                    }
                }       //obj.Visible = false;
                Common.AddFormOnTab(obj, "tabPage" + iID.ToString(), tbCtrl.strVietNamese, tbCtrl.strEnglish, tbCtrl.strOtherLanguage, tbCtrl.strImageFileName, tbCtrl.strObject_ID);
            }
        }
示例#2
0
        void tsmiRunMethod(object sender, EventArgs e)
        {
            tsmiControl tsmiMenu = (tsmiControl)sender;

            if (tsmiMenu.MethodName == string.Empty)
            {
                return;
            }

            //object obj = Common.RunMethod(tsmiMenu);


            frmMain      frmM      = (frmMain)this.FindForm();
            tbTabControl tbTabMain = frmM.tbTabMain;

            if (tsmiMenu != null)
            {
                tbTabPageControl tbTabPage = new tbTabPageControl();
                tbTabPage.Name = "tabPage" + tsmiMenu.ID.ToString();

                for (int i = 0; i < tbTabMain.TabPages.Count; i++)
                {
                    if (tbTabPage.Name == tbTabMain.TabPages[i].Name)
                    {
                        tbTabMain.SelectedTabPage = tbTabMain.TabPages[i];
                        return;
                    }
                }
                tbTabPage.Text = tsmiMenu.Text;

                Form obj = (Form)Common.RunMethodTab(tsmiMenu);
                if (obj == null)
                {
                    return;
                }
                frmM.tbTabMain.Visible = true;

                Common.AddFormOnTab(obj, "tabPage" + tsmiMenu.ID.ToString(), tsmiMenu.Vietnamese, tsmiMenu.English, tsmiMenu.Other, tsmiMenu.ImageName);
            }
        }
示例#3
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;
             */
        }
示例#4
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);

            //
        }