private static void DoMainProcessCmdKeyProd(ref Message msg, Keys keyData, frmMainBase frmMain, Timer timer1) { int k = msg.WParam.ToInt32(); if (k == 120)//F9 { Int64 deptOld = CApplication.App.CurrentSession.DeptId; frmReSetDept frmLg = new frmReSetDept(); timer1.Stop(); if (frmLg.ShowDialog() == DialogResult.OK) { if (CApplication.App.CurrentSession.DeptId != deptOld) { Form[] charr = frmMain.MdiChildren; foreach (Form frm in charr) { frm.Close(); } CApplication.App.CurrentSession.DeptNme = frmLg.strDeptName; frmMain.SetDepartTxt(CApplication.App.CurrentSession.DeptNme); string strName = System.Configuration.ConfigurationManager.AppSettings["SystemName"]; frmMain.Text = strName + "--" + CApplication.App.CurrentSession.DeptNme; string[] strKey = "Form,EUser_Id,EDept_Id,EFy_Id".Split(",".ToCharArray()); string[] strVal = new string[] { "frmLogin" , CApplication.App.CurrentSession.UserId.ToString() , CApplication.App.CurrentSession.DeptId.ToString() , CApplication.App.CurrentSession.FyId.ToString() }; MethodRequest req = new MethodRequest(); req.ParamKeys = strKey; req.ParamVals = strVal; req.ProceName = "Get_Form_Load_Table"; req.ProceDb = ProjectSpecialSet.BtProduceCS; CApplication.App.DtUserBasicSet = ServerRequestProcess.DbRequest.DataRequest_By_DataTable(req); CApplication.App.DtUserBasicSet.AcceptChanges(); DataRow[] drSkin = CApplication.App.DtUserBasicSet.Select("SetKey='SkinName'"); if (drSkin.Length > 0) { frmMain.InitDepSkin(drSkin[0]["SetValue"].ToString()); } } } timer1.Start(); } }
private static void DoMainProcessCmdKeyMJ(ref Message msg, Keys keyData, frmMainBase frmMain, Timer timer1) { int k = msg.WParam.ToInt32(); if (k == 112)//F1 { StaticFunctions.OpenChildEditorForm(true, "ProduceManager", frmMain, "员工操作", "frmTst_UserReceDeliChkEdit", "VIEW", string.Empty); } else if (k == 113)//F2 { StaticFunctions.OpenChildEditorForm(true, "ProduceManager", frmMain, "收发交接维护", "frmTst_MoveEdit", "VIEW", string.Empty); } else if (k == 114)//F3 { StaticFunctions.OpenBsuChildEditorForm(true, "ProduceManager", frmMain, "进料入库维护", "frmSysBusEdit", "frmTst_MaterialOrdEdit", "ADD", "BusClassName=frmTst_MaterialOrdEdit", null); } else if (k == 115)//F4 { StaticFunctions.OpenBsuChildEditorForm(true, "ProduceManager", frmMain, "出料出库维护", "frmSysBusEdit", "frmTst_MaterialOrdOutEdit", "ADD", "BusClassName=frmTst_MaterialOrdOutEdit", null); } else if (k == 117)//F6 { StaticFunctions.OpenBsuChildEditorForm(true, "ProduceManager", frmMain, "进饰入库维护", "frmSysBusEdit", "frmTst_RetOrdEdit", "ADD", "BusClassName=frmTst_RetOrdEdit", null); } else if (k == 118)//F7 { StaticFunctions.OpenBsuChildEditorForm(true, "ProduceManager", frmMain, "实物盘点维护", "frmSysBusEdit", "frmTst_ProdChkOrdEdit", "ADD", "BusClassName=frmTst_ProdChkOrdEdit", null); } else if (k == 119)//F8 { Form frmEx = StaticFunctions.GetExistedChildForm(frmMain, "frmTst_StorageChkEdit", true); if (frmEx != null) { (frmEx as frmTst_StorageChkEdit).ReGetData(); (frmEx as frmTst_StorageChkEdit).Activate(); } else { StaticFunctions.OpenChildEditorForm(true, "ProduceManager", frmMain, "收发库存盘点", "frmTst_StorageChkEdit", "VIEW", string.Empty); } } else if (k == 120)//F9 { Int64 deptOld = CApplication.App.CurrentSession.DeptId; frmReSetDept frmLg = new frmReSetDept(); timer1.Stop(); if (frmLg.ShowDialog() == DialogResult.OK) { if (CApplication.App.CurrentSession.DeptId != deptOld) { Form[] charr = frmMain.MdiChildren; foreach (Form frm in charr) { frm.Close(); } CApplication.App.CurrentSession.DeptNme = frmLg.strDeptName; frmMain.SetDepartTxt(CApplication.App.CurrentSession.DeptNme); string strName = System.Configuration.ConfigurationManager.AppSettings["SystemName"]; frmMain.Text = strName + "--" + CApplication.App.CurrentSession.DeptNme; string[] strKey = "Form,EUser_Id,EDept_Id,EFy_Id".Split(",".ToCharArray()); string[] strVal = new string[] { "frmLogin" , CApplication.App.CurrentSession.UserId.ToString() , CApplication.App.CurrentSession.DeptId.ToString() , CApplication.App.CurrentSession.FyId.ToString() }; MethodRequest req = new MethodRequest(); req.ParamKeys = strKey; req.ParamVals = strVal; req.ProceName = "Get_Form_Load_Table"; req.ProceDb = ProjectSpecialSet.BtProduceCS; CApplication.App.DtUserBasicSet = ServerRequestProcess.DbRequest.DataRequest_By_DataTable(req); CApplication.App.DtUserBasicSet.AcceptChanges(); DataRow[] drSkin = CApplication.App.DtUserBasicSet.Select("SetKey='SkinName'"); if (drSkin.Length > 0) { frmMain.InitDepSkin(drSkin[0]["SetValue"].ToString()); } } } timer1.Start(); } else if (k == 192)//~ { System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(); System.Diagnostics.Process proc = new System.Diagnostics.Process(); //设置外部程序名(记事本用 notepad.exe 计算器用 calc.exe) info.FileName = "calc.exe"; //设置外部程序的启动参数 info.Arguments = ""; //设置外部程序工作目录为c:\windows info.WorkingDirectory = "c:/windows/"; try { proc = System.Diagnostics.Process.Start(info); } catch { MessageBox.Show("系统找不到指定的程序文件", "错误提示!"); } } }