Esempio n. 1
0
        private void MyShowDialog()
        {
            List <Model.T_WorkbayIPConfig> list = bll.FindT_WorkbayIPConfig().Where(m => m.IPAddress == bll.IPAddress).ToList();

            if (list.Count > 0)
            {
                switch (list[0].WorkbaySchemeID)
                {
                case "1":
                    Main m = new Main();
                    m.Owner = this;
                    this.Hide();
                    m.ShowDialog();
                    break;

                case "2":
                    MainGroup mg = new MainGroup();
                    mg.Owner = this;
                    this.Hide();
                    mg.ShowDialog();
                    break;

                case "3":
                    MainFCSKTV mfcsktv = new MainFCSKTV();
                    mfcsktv.Owner = this;
                    this.Hide();
                    mfcsktv.ShowDialog();
                    break;

                case "4":
                    MainGroupFC mfc = new MainGroupFC();
                    mfc.Owner = this;
                    this.Hide();
                    mfc.ShowDialog();
                    break;

                case "5":
                    MainRCRB mrcrb = new MainRCRB();
                    mrcrb.Owner = this;
                    this.Hide();
                    mrcrb.ShowDialog();
                    break;
                }
            }
            else
            {
                MessageBox.Show(bll.IPAddress + " 该IP地址未配置");
            }
        }
Esempio n. 2
0
        private void MyShowDialog()
        {
            zkfp2.Terminate();
            cbRegTmp = 0;
            if (captureThread != null)
            {
                captureThread.Abort();
            }
            Global.GlobalFieid.IsLogin = true;
            if (Global.GlobalFieid.LoginType == "1")
            {
                Global.GlobalFieid.LoginRecordID = Guid.NewGuid().ToString();
                T_LoginRecord_Bll.Add(Global.GlobalFieid.LoginRecordID, bll.WorkbayName, Global.GlobalFieid.StaffID);
                Global.GlobalFieid.IsLogOut = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    Mes.MainGroup Main = new MainGroup();
                    Main = (MainGroup)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                {
                    Mes.MainGroupFC Main = new MainGroupFC();
                    Main = (MainGroupFC)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Mes.Main Main = new Main();
                    Main = (Main)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                {
                    Mes.MainFCSKTV Main = new MainFCSKTV();
                    Main = (MainFCSKTV)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    Mes.MainRCRB Main = new MainRCRB();
                    Main = (MainRCRB)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    Mes.MainGroupRCRB Main = new MainGroupRCRB();
                    Main = (MainGroupRCRB)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                {
                    Mes.MainGroupM Main = new MainGroupM();
                    Main = (MainGroupM)this.Owner;
                    Main.SetStaff();
                    this.Dispose();
                }
            }
            if (Global.GlobalFieid.LoginType == "2")
            {
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    Mes.MainGroup Main = new MainGroup();
                    Main = (MainGroup)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                {
                    MainGroupFC Main;
                    Main = (MainGroupFC)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                {
                    MainFCSKTV Main;
                    Main = (MainFCSKTV)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                {
                    MainGroupM Main;
                    Main = (MainGroupM)this.Owner;
                    Main.Rework();
                    this.Dispose();
                }
            }

            if (Global.GlobalFieid.LoginType == "3")
            {
                IsProduction = false;
                IsCraft      = false;
                IsQuailty    = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    MainGroup Main;
                    Main = (MainGroup)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                {
                    MainGroupFC Main;
                    Main = (MainGroupFC)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                {
                    MainFCSKTV Main;
                    Main = (MainFCSKTV)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                {
                    MainGroupM Main;
                    Main = (MainGroupM)this.Owner;
                    Main.Bypass();
                    this.Dispose();
                }
            }

            if (Global.GlobalFieid.LoginType == "4")
            {
                IsProduction = false;
                IsCraft      = false;
                IsQuailty    = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    MainGroup Main;
                    Main = (MainGroup)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.TPS_Stop();
                    this.Dispose();
                }
                //else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                //{
                //    MainGroupFC Main;
                //    Main = (MainGroupFC)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
                //else if (Global.GlobalFieid.MyControl.Name == "MainGroupM")
                //{
                //    MainGroupM Main;
                //    Main = (MainGroupM)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}

                //else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                //{
                //    MainFCSKTV Main;
                //    Main = (MainFCSKTV)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
            }
            if (Global.GlobalFieid.LoginType == "5")
            {
                IsProduction = false;
                IsCraft      = false;
                IsQuailty    = false;
                if (Global.GlobalFieid.MyControl.Name == "MainGroup")
                {
                    MainGroup Main;
                    Main = (MainGroup)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainRCRB")
                {
                    MainRCRB Main;
                    Main = (MainRCRB)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "MainGroupRCRB")
                {
                    MainGroupRCRB Main;
                    Main = (MainGroupRCRB)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                else if (Global.GlobalFieid.MyControl.Name == "Main")
                {
                    Main Main;
                    Main = (Main)this.Owner;
                    Main.TPS_Start();
                    this.Dispose();
                }
                //else if (Global.GlobalFieid.MyControl.Name == "MainGroupFC")
                //{
                //    MainGroupFC Main;
                //    Main = (MainGroupFC)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
                //else if (Global.GlobalFieid.MyControl.Name == "Main")
                //{
                //    Main Main;
                //    Main = (Main)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
                //else if (Global.GlobalFieid.MyControl.Name == "MainFCSKTV")
                //{
                //    MainFCSKTV Main;
                //    Main = (MainFCSKTV)this.Owner;
                //    Main.Bypass();
                //    this.Dispose();
                //}
            }
        }