Beispiel #1
0
        private void staffToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmStaff frm = new frmStaff();

            frm.lblUser.Text = lblUser.Text;
            //frm.Reset();
            frm.Show();
        }
Beispiel #2
0
 private void btnStaff_Click(object sender, EventArgs e)
 {
     if (checkQuyen(QUYEN))
     {
         pnZone.Controls.Clear();
         frmStaff frmStaff = new frmStaff();
         frmStaff.TopLevel = false;
         pnZone.Controls.Add(frmStaff);
         frmStaff.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         frmStaff.AutoScroll      = true;
         frmStaff.Dock            = DockStyle.Fill;
         frmStaff.Show();
     }
 }
Beispiel #3
0
        private void openChildren(PageNo pPageNo)
        {
            Type targetFormType = typeof(frmCowPart);

            if (pPageNo == PageNo.ManageStaff)
            {
                targetFormType = typeof(frmStaff);
            }
            else if (pPageNo == PageNo.ManageMember)
            {
                targetFormType = typeof(frmMember);
            }
            else if (pPageNo == PageNo.CowPart)
            {
                targetFormType = typeof(frmCowPart);
            }
            else if (pPageNo == PageNo.StaffTimeStamp)
            {
                targetFormType = typeof(frmStaffTimeStamp);
            }
            else if (pPageNo == PageNo.CowList)
            {
                targetFormType = typeof(frmCowList);
            }
            else if (pPageNo == PageNo.Department)
            {
                targetFormType = typeof(frmDepartment);
            }
            else if (pPageNo == PageNo.Faction)
            {
                targetFormType = typeof(frmFaction);
            }

            // tsmMainData
            else if (pPageNo == PageNo.CowBreed)
            {
                targetFormType = typeof(frmCowBreed);
            }
            else if (pPageNo == PageNo.CowHorn)
            {
                targetFormType = typeof(frmCowHorn);
            }
            else if (pPageNo == PageNo.CowPurpose)
            {
                targetFormType = typeof(frmCowPurpose);
            }
            else if (pPageNo == PageNo.CowStatus)
            {
                targetFormType = typeof(frmCowStatus);
            }
            else if (pPageNo == PageNo.CowGrowUpLevel)
            {
                targetFormType = typeof(frmCowGrowLevel);
            }
            else if (pPageNo == PageNo.CowColor)
            {
                targetFormType = typeof(frmCowColor);
            }
            else if (pPageNo == PageNo.CowStall)
            {
                targetFormType = typeof(frmCowStall);
            }
            else if (pPageNo == PageNo.CowLocation)
            {
                targetFormType = typeof(frmCowLocation);
            }

            bool isExist = false;

            foreach (Form f in this.MdiChildren)
            {
                if (f.GetType() == targetFormType)
                {
                    f.Activate();
                    if (f.WindowState != FormWindowState.Maximized)
                    {
                        f.WindowState = FormWindowState.Maximized;
                    }
                    isExist = true;
                    break;
                }
            }

            if (!isExist)
            {
                Form targetForm = null;

                if (pPageNo == PageNo.ManageStaff)
                {
                    targetForm = new frmStaff();
                }
                else if (pPageNo == PageNo.ManageMember)
                {
                    targetForm = new frmMember();
                }
                else if (pPageNo == PageNo.CowPart)
                {
                    targetForm = new frmCowPart();
                }
                else if (pPageNo == PageNo.StaffTimeStamp)
                {
                    targetForm = new frmStaffTimeStamp();;
                }
                else if (pPageNo == PageNo.CowList)
                {
                    targetForm = new frmCowList();
                }
                else if (pPageNo == PageNo.Department)
                {
                    targetForm = new frmDepartment();
                }
                else if (pPageNo == PageNo.Faction)
                {
                    targetForm = new frmFaction();
                }

                // tsmMainData
                else if (pPageNo == PageNo.CowBreed)
                {
                    targetForm = new frmCowBreed();
                }
                else if (pPageNo == PageNo.CowHorn)
                {
                    targetForm = new frmCowHorn();
                }
                else if (pPageNo == PageNo.CowPurpose)
                {
                    targetForm = new frmCowPurpose();
                }
                else if (pPageNo == PageNo.CowStatus)
                {
                    targetForm = new frmCowStatus();
                }
                else if (pPageNo == PageNo.CowGrowUpLevel)
                {
                    targetForm = new frmCowGrowLevel();
                }
                else if (pPageNo == PageNo.CowColor)
                {
                    targetForm = new frmCowColor();
                }
                else if (pPageNo == PageNo.CowStall)
                {
                    targetForm = new frmCowStall();
                }
                else if (pPageNo == PageNo.CowLocation)
                {
                    targetForm = new frmCowLocation();
                }

                targetForm.MdiParent = this;
                targetForm.Show();
                targetForm.WindowState = FormWindowState.Maximized;

                MainFunction.AddOrRemaveChildName(pMdiParent: this,
                                                  pChildName: targetForm.Name,
                                                  pChildText: targetForm.Text,
                                                  pIsAdd: true);
            }
        }
    public static void Main()
    {
        frmStaff staff = new frmStaff();

        Application.Run(staff);
    }
Beispiel #5
0
    private void btnStaff_Click(object sender, EventArgs e)
    {
        frmStaff staff = new frmStaff(this);

        staff.Show();
    }