private void simpleButton2_Click(object sender, EventArgs e) { this.Hide(); string Caption = "BTS by Month"; switch (Lang) { case "Vn": Caption = "BTS theo tháng"; break; default: Caption = "BTS by Month"; break; } Form fc = Application.OpenForms["FRM_SMT_BTS"]; if (fc != null) { //fc.Close(); fc.Show(); ////f.TopMost = true; } else { FRM_SMT_BTS f = new FRM_SMT_BTS(Caption, 1, line, mline, Lang); f.Show(); //f.TopMost = true; } }
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_OS_DEFFECTIVE_STATUS"]; if (fc1 != null) { fc1.Close(); } FORM_OS_DEFFECTIVE_STATUS DEF = new FORM_OS_DEFFECTIVE_STATUS(); F = DEF; //pic_under.Visible = true; break; case 3: /*OS&D * Author: DO.IT*/ fc1 = Application.OpenForms["FRM_SMT_OS_OSD_MONTH"]; if (fc1 != null) { fc1.Close(); } FRM_SMT_OS_OSD_MONTH IN_OSD = new FRM_SMT_OS_OSD_MONTH(); F = IN_OSD; break; case 4: /*Mold OverHoul * Author: Ngọc.IT*/ fc1 = Application.OpenForms["FORM_OS_MOLD_OVERHAUL"]; if (fc1 != null) { fc1.Close(); } FORM_OS_MOLD_OVERHAUL OS_OVERHAUL = new FORM_OS_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: pic_under.Visible = true; 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_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_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: pic_under.Visible = true; break; case 14: pic_under.Visible = true; 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; 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; case 51: /*BTS * * Author: PHUOC.IT*/ fc1 = Application.OpenForms["FORM_SMT_BTS"]; if (fc1 != null) { fc1.Close(); } FRM_SMT_OS_TOPO_DAILY FRM_SMT_TOPO = new FRM_SMT_OS_TOPO_DAILY(); F = FRM_SMT_TOPO; break; case 16: pic_under.Visible = true; 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; } }