Exemple #1
0
        void DWMYClick(string ButtonCap, string ButtonCD)
        {
            //MessageBox.Show(ButtonCap + "    " + ButtonCD);
            switch (ButtonCD)
            {
            case "C":
                this.Close();
                break;

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

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

                    f1.Show();
                }
                break;
            }
        }
        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["FORM_DEFFECTIVE_STATUS"];
                    //if (fc1 != null)
                    //    fc1.Close();
                    //FORM_DEFFECTIVE_STATUS DEFECTIVE = new FORM_DEFFECTIVE_STATUS();
                    F = IP.ComVar.DEFECTIVE;

                    break;

                case 3:
                    /*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 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_MOLD_PRODUCTION"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FORM_MOLD_PRODUCTION OS_LAYOUT = new FORM_MOLD_PRODUCTION();
                    F = OS_LAYOUT;

                    break;

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

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

                case 8:    /*OEE MONTH
                            * Author: LUAN.IT*/
                    fc1 = Application.OpenForms["FRM_SMT_IP_OEE"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_IP_OEE IP_OEE_MON = new FRM_SMT_IP_OEE();
                    F = IP_OEE_MON;
                    //F = OS_DSF.ComVar.IP_OEE;
                    //picContructor.Visible = !picContructor.Visible;
                    break;

                case 9:
                    picContructor.Visible = true;
                    break;

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

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

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

                //case 13:
                //    break;
                //case 14:
                //    break;
                case 15:
                    /*LeadTime
                     * Author: NGOC.IT*/
                    fc1 = Application.OpenForms["FORM_LEADTIME_SYN"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FORM_LEADTIME_SYN LEADTIME_OS = new FORM_LEADTIME_SYN();
                    F = LEADTIME_OS;
                    break;

                case 16:
                    fc1 = Application.OpenForms["FORM_IP_CHAMBER_ZONE"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FORM_IP_CHAMBER_ZONE CHAMBER_ZONE = new FORM_IP_CHAMBER_ZONE();
                    F = CHAMBER_ZONE;
                    break;

                case 50:
                    /*BTS
                     *
                     * Author: PHUOC.IT*/
                    fc1 = Application.OpenForms["FORM_SMT_BTS"];
                    if (fc1 != null)
                    {
                        fc1.Close();
                    }
                    FRM_SMT_BTS FRM_SMT_BTS = new FRM_SMT_BTS();
                    F = FRM_SMT_BTS;
                    break;

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

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