Esempio n. 1
0
        /*public static int GetIDIndex(string id, string colName, DataTable NavDt)
         * {
         *  for (int i = 0; i < NavDt.Rows.Count; i++)
         *  {
         *      if (id == NavDt.Rows[i][colName].ToString().Trim())
         *          return i;
         *  }
         *  return -1;
         * }*/



        private void ultraToolbarsManager1_ToolClick_1(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
        {
            if (main_door == "All")
            {
                switch (e.Tool.Key)
                {
                case "Exit Application":
                    Application.Exit();
                    break;

                case "Monitor":
                    frmEmpMange rr = new frmEmpMange();
                    if (!CheckFormOpen(rr))
                    {
                        rr.MdiParent = this;
                        rr.Text      = "Monitor";
                        rr.Show();
                    }
                    break;

                case "ALL_TRANS":
                    FrmAllEmpTrans rr2 = new FrmAllEmpTrans();
                    if (!CheckFormOpen(rr2))
                    {
                        rr2.MdiParent = this;
                        rr2.Text      = "All Transactions";
                        rr2.Show();
                    }
                    break;

                case "TRANS":
                    FrmEmpTrans rr3 = new FrmEmpTrans();
                    if (!CheckFormOpen(rr3))
                    {
                        rr3.MdiParent = this;
                        rr3.Text      = "Transactions";
                        rr3.Show();
                    }
                    break;

                case "IN_COMPANY":
                    FrmNowIN rr4 = new FrmNowIN();
                    if (!CheckFormOpen(rr4))
                    {
                        rr4.MdiParent = this;
                        rr4.Text      = "In Company";
                        rr4.Show();
                    }
                    break;

                case "DELAYY":
                    Frm_Delay rr5 = new Frm_Delay();
                    if (!CheckFormOpen(rr5))
                    {
                        rr5.MdiParent = this;
                        rr5.Text      = "Delay";
                        rr5.Show();
                    }
                    break;
                }
            }
            else
            {
                switch (e.Tool.Key)
                {
                case "Exit Application":
                    Application.Exit();
                    break;

                case "Monitor":
                    frmEmpMange rr = new frmEmpMange();
                    if (!CheckFormOpen(rr))
                    {
                        rr.MdiParent = this;
                        rr.Text      = "Monitor";
                        rr.Show();
                    }
                    break;
                }
            }
        }
Esempio n. 2
0
        private void ultraToolbarsManager1_ToolClick_1(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
        {
            if (ROLE == 1)
            {
                switch (e.Tool.Key)
                {
                case "Exit Application":
                    Application.Exit();
                    break;

                case "CARDS":
                    frmEmpMange rr = new frmEmpMange();
                    if (!CheckFormOpen(rr))
                    {
                        rr.MdiParent = this;
                        rr.Text      = "Employee";
                        rr.Show();
                    }
                    break;

                case "LoadTransation":
                    DeviceSetting rr2 = new DeviceSetting();
                    rr2.MdiParent = this;
                    rr2.Text      = "Load Transations";
                    //rr2.ShowDialog();
                    rr2.Show();
                    break;

                case "Transaction":
                    //if (frmMainForm._ConfigPlace == "cairo")
                    //{
                    FrmEmpTrans rr3 = new FrmEmpTrans();
                    if (!CheckFormOpen(rr3))
                    {
                        rr3.MdiParent = this;
                        rr3.Text      = "Transations";
                        rr3.Show();
                    }
                    //}
                    break;

                case "AllTransaction":
                    FrmAllEmpTrans rr4 = new FrmAllEmpTrans();
                    if (!CheckFormOpen(rr4))
                    {
                        rr4.MdiParent = this;
                        rr4.Text      = "All Transations";
                        rr4.Show();
                    }
                    break;

                case "Users":
                    frmUsers rr5 = new frmUsers();
                    if (!CheckFormOpen(rr5))
                    {
                        rr5.MdiParent = this;
                        rr5.Text      = "Users";
                        rr5.Show();
                    }
                    break;

                case "Department":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmDepartments rr6 = new FrmDepartments();
                        if (!CheckFormOpen(rr6))
                        {
                            rr6.MdiParent = this;
                            rr6.Text      = "Department";
                            rr6.Show();
                        }
                    }
                    break;

                case "VisitorCard":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        frmVisitor rr7 = new frmVisitor();
                        //rr2.MdiParent = this;
                        rr7.Text = "Print Visitor Cards";
                        rr7.ShowDialog();
                    }
                    break;

                case "Shift":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmShifts rr8 = new FrmShifts();
                        if (!CheckFormOpen(rr8))
                        {
                            rr8.MdiParent = this;
                            rr8.Text      = "Shifts";
                            rr8.Show();
                        }
                    }
                    break;

                case "ChangeID":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmChangeID rr9 = new FrmChangeID();
                        //rr8.MdiParent = this;
                        rr9.Text = "Change ID";
                        rr9.ShowDialog();
                    }
                    break;

                case "NOW_IN":
                    //if (frmMainForm._ConfigPlace == "cairo")
                    //{
                    FrmNowIN rr10 = new FrmNowIN();
                    if (!CheckFormOpen(rr10))
                    {
                        rr10.MdiParent = this;
                        rr10.Text      = "In Company";
                        rr10.Show();
                    }
                    //}
                    break;

                case "DELAY":
                    //    if (frmMainForm._ConfigPlace == "cairo")
                    //    {
                    Frm_Delay rr11 = new Frm_Delay();
                    if (!CheckFormOpen(rr11))
                    {
                        rr11.MdiParent = this;
                        rr11.Text      = "Delays";
                        rr11.Show();
                    }
                    //    }
                    break;

                case "daylight":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        Frm_change rr12 = new Frm_change();
                        if (!CheckFormOpen(rr12))
                        {
                            //rr12.MdiParent = this;
                            rr12.Text = "Daylight";
                            rr12.ShowDialog();
                        }
                    }
                    break;

                case "SEND DATA":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        Frm_Copy_Pic rr100 = new Frm_Copy_Pic();
                        if (!CheckFormOpen(rr100))
                        {
                            //rr100.MdiParent = this;
                            rr100.Text = "SEND";
                            rr100.ShowDialog();
                        }
                    }
                    break;

                case "PERMIT":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmPermit rr101 = new FrmPermit();
                        if (!CheckFormOpen(rr101))
                        {
                            rr101.MdiParent = this;
                            rr101.Text      = "Permit";
                            rr101.Show();
                        }
                    }
                    break;

                case "STATUS":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmStatus rr102 = new FrmStatus();
                        if (!CheckFormOpen(rr102))
                        {
                            rr102.MdiParent = this;
                            rr102.Text      = "Status";
                            rr102.Show();
                        }
                    }
                    break;
                }
            }
            else if (ROLE == 2)
            {
                switch (e.Tool.Key)
                {
                case "Exit Application":
                    Application.Exit();
                    break;

                case "CARDS":
                    frmEmpMange rr = new frmEmpMange();
                    if (!CheckFormOpen(rr))
                    {
                        rr.MdiParent = this;
                        rr.Text      = "Employee";
                        rr.Show();
                    }
                    break;

                case "Department":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmDepartments rr6 = new FrmDepartments();
                        if (!CheckFormOpen(rr6))
                        {
                            rr6.MdiParent = this;
                            rr6.Text      = "Department";
                            rr6.Show();
                        }
                    }
                    break;

                case "Shift":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmShifts rr8 = new FrmShifts();
                        if (!CheckFormOpen(rr8))
                        {
                            rr8.MdiParent = this;
                            rr8.Text      = "Shifts";
                            rr8.Show();
                        }
                    }
                    break;

                case "PERMIT":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmPermit rr101 = new FrmPermit();
                        if (!CheckFormOpen(rr101))
                        {
                            rr101.MdiParent = this;
                            rr101.Text      = "Permit";
                            rr101.Show();
                        }
                    }
                    break;

                case "STATUS":
                    if (frmMainForm._ConfigPlace == "cairo")
                    {
                        FrmStatus rr102 = new FrmStatus();
                        if (!CheckFormOpen(rr102))
                        {
                            rr102.MdiParent = this;
                            rr102.Text      = "Status";
                            rr102.Show();
                        }
                    }
                    break;
                }
            }
        }