Exemplo n.º 1
0
        void DWMYClick(string ButtonCap, string ButtonCD)
        {
            //MessageBox.Show(ButtonCap + "    " + ButtonCD);
            switch (ButtonCD)
            {
            case "C":
                timer2.Stop();
                this.Close();
                break;

            case "D":
                this.Close();
                Form fc = Application.OpenForms["FRM_SMT_OS_PROD_DAILY"];
                if (fc != null)
                {
                    fc.Show();
                }
                else
                {
                    FRM_SMT_OS_PROD_DAILY f = new FRM_SMT_OS_PROD_DAILY();
                    f.Show();
                }
                break;

            case "M":
                this.Close();
                Form fc1 = Application.OpenForms["FRM_SMT_OS_INVENTORY"];
                if (fc1 != null)
                {
                    fc1.Show();
                }
                else
                {
                    FRM_SMT_OS_INVENTORY f1 = new FRM_SMT_OS_INVENTORY();
                    f1.Show();
                }
                break;

            case "Y":
                this.Close();
                Form fc2 = Application.OpenForms["FRM_SMT_OS_PROD_YEAR"];
                if (fc2 != null)
                {
                    fc2.Show();
                }
                else
                {
                    FRM_SMT_OS_PROD_YEAR f2 = new FRM_SMT_OS_PROD_YEAR();
                    f2.Show();
                }
                break;
            }
        }
Exemplo n.º 2
0
        void MenuOnClick(string MenuName, string BtnCD)
        {
            try
            {
                //   MessageBox.Show(MenuName + "_" + BtnCD);
                System.Windows.Forms.Form F = null;
                Form fc1 = null;
                this.Cursor = Cursors.WaitCursor;
                switch (Convert.ToInt32(BtnCD))
                {
                case 1:
                    //Empty
                    break;

                case 2:
                    /*Internal OS&D
                    *  Author: DO.IT*/
                    fc1 = Application.OpenForms["FRM_SMT_IP_OSD_MONTH"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_IP_OSD_MONTH IN_OSD = new FRM_SMT_IP_OSD_MONTH();
                    F = IN_OSD;

                    break;

                case 3:
                    /*External OS&D
                    *  Author: DO.IT*/
                    fc1 = Application.OpenForms["FRM_SMT_OS_OSD_EXT_MONTH"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_OS_OSD_EXT_MONTH EXT_OSD = new FRM_SMT_OS_OSD_EXT_MONTH();
                    F = EXT_OSD;

                    break;

                case 4:
                    /*Mold OverHoul
                     * Author: Ngọc.IT*/
                    fc1 = Application.OpenForms["FORM_IP_MOLD_OVERHAUL"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FORM_IP_MOLD_OVERHAUL OS_OVERHAUL = new FORM_IP_MOLD_OVERHAUL();
                    F = OS_OVERHAUL;

                    break;

                case 5:
                    /*Mold Layout
                     * Author: Ngọc.IT*/
                    fc1 = Application.OpenForms["FORM_OS_MACHINE_LAYOUT"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FORM_OS_MACHINE_LAYOUT OS_LAYOUT = new FORM_OS_MACHINE_LAYOUT();
                    F = OS_LAYOUT;

                    break;

                case 6:
                    /*Mold Layout
                     * Author: Ngọc.IT*/
                    fc1 = Application.OpenForms["FRM_SMT_OS_MOLD_ACTUAL_PLAN"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_OS_MOLD_ACTUAL_PLAN MOLD_PLAN_ACTUAL = new FRM_SMT_OS_MOLD_ACTUAL_PLAN();
                    F = MOLD_PLAN_ACTUAL;
                    break;

                case 7:
                    /*Production Status
                     * Author: DO.IT*/
                    fc1 = Application.OpenForms["FRM_SMT_OS_PROD_DAILY"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_OS_PROD_DAILY PROD_STATS = new FRM_SMT_OS_PROD_DAILY();
                    F = PROD_STATS;
                    break;

                case 8:    /*OEE MONTH
                            * Author: LUAN.IT*/
                    fc1 = Application.OpenForms["FRM_SMT_OS_OEE"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    Machinery.FRM_SMT_OS_OEE OS_OEE = new Machinery.FRM_SMT_OS_OEE();
                    F = OS_OEE;
                    break;

                case 9:
                    break;

                case 10:
                    fc1 = Application.OpenForms["FRM_SMT_OS_INVENTORY"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_OS_INVENTORY OS_INV = new FRM_SMT_OS_INVENTORY();
                    F = OS_INV;
                    break;

                case 11:
                    fc1 = Application.OpenForms["FRM_SMT_OS_FSS_INVENTORY"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_OS_FSS_INVENTORY OS_FSS_INV = new FRM_SMT_OS_FSS_INVENTORY();
                    F = OS_FSS_INV;
                    break;
                    break;

                case 12:
                    /*Absent
                     * Author: NGOC.IT*/
                    fc1 = Application.OpenForms["FRM_SMT_OS_HR_ABSENT"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_OS_HR_ABSENT HR_ABSENT = new FRM_SMT_OS_HR_ABSENT();
                    F = HR_ABSENT;
                    break;

                case 13:
                    break;

                case 14:
                    break;

                case 15:
                    ///*LeadTime
                    //  Author: NGOC.IT*/
                    //fc1 = Application.OpenForms["FORM_SMT_OS_LEADTIME"];
                    //if (fc1 != null)
                    //    fc1.Close();

                    //FORM_SMT_OS_LEADTIME LEADTIME_OS = new FORM_SMT_OS_LEADTIME();
                    //F = LEADTIME_OS;
                    break;

                default:
                    break;
                }
                if (F != null)
                {
                    F.Show();
                    F.BringToFront();

                    if (Db.INSERT_FRM_LOG("OS_SMT", this.Name + " (Inside Office)", BtnCD, F.Name, "Open Form", GetIP() + "/" + System.Environment.MachineName))
                    {
                    }
                    this.Cursor = Cursors.Default;
                }
                else
                {
                    this.Cursor = Cursors.Default;
                }
            }
            catch { this.Cursor = Cursors.Default; }
        }