private void aboutToolStripMenuItem1_Click(object sender, EventArgs e) { AboutBox.ShowDialog(); }
private void ToolStripMenuItem_Click(object sender, EventArgs e) { try { switch ((sender as ToolStripMenuItem).Name) { case "登录ToolStripMenuItem": int result = LoginBox(out LoginName, out RoleName); if (result == 1) { toolStripLabel_role.Text = $"【DB Server】: {mDBM.conn.DataSource.Substring(0, mDBM.conn.DataSource.IndexOf(':'))}, 【用户】: {LoginName}, 【角色】: {RoleName},【MAC】:{terminalMAC},【IP】:{terminalIP}"; LoginPermissionProcess(RoleName); } else if (result == 0) { LogoutPermissionProcess(); ToolStripMenuItem_Click(登录ToolStripMenuItem, new EventArgs()); } else { LogoutPermissionProcess(); } break; case "密码修改ToolStripMenuItem": if (form_password == null || form_password.IsDisposed) { form_password = new Form_Password(); } if (DialogResult.Abort == form_password.ShowDialog()) //ChangePassword executed but failed { LogoutPermissionProcess(); } break; case "注销ToolStripMenuItem": LogoutPermissionProcess(); ToolStripMenuItem_Click(登录ToolStripMenuItem, new EventArgs()); break; case "退出ToolStripMenuItem": if (mDBM != null) { if (!String.IsNullOrEmpty(mDBM.loginName)) { mDBM.Logout(); } mDBM.Close(); } Dispose(); Application.Exit(); break; case "预约计次培训ToolStripMenuItem": getSubForm(typeof(Form_TrainBooking)); ((Form_TrainBooking)subForm).TrainingMode = Form_TrainBooking.TrainingModeEnum.ByTimes; subForm.Text = "预约计次培训"; subForm.Show(); break; case "预约计时培训ToolStripMenuItem": getSubForm(typeof(Form_TrainBooking)); ((Form_TrainBooking)subForm).TrainingMode = Form_TrainBooking.TrainingModeEnum.ByTime; subForm.Text = "预约计时培训"; subForm.Show(); break; case "支付流水ToolStripMenuItem": getSubForm(typeof(Form_PaymentDetail)).Show(); break; case "分车叫号ToolStripMenuItem": getSubForm(typeof(Form_CarAllocation)).Show(); break; case "过程查询ToolStripMenuItem": getSubForm(typeof(Form_Process)).Show(); break; case "预约及签到ToolStripMenuItem": getSubForm(typeof(Form_Booking)).Show(); break; case "分组及分车ToolStripMenuItem": getSubForm(typeof(Form_Grouping)).Show(); break; case "考试状态ToolStripMenuItem": getSubForm(typeof(Form_ExamStatus)).Show(); break; case "成绩打印ToolStripMenuItem": getSubForm(typeof(Form_StudentExam)).Show(); break; case "综合统计ToolStripMenuItem": getSubForm(typeof(Form_SummaryStatistices)).Show(); break; case "综合查询ToolStripMenuItem": getSubForm(typeof(Form_SummaryQuery)).Show(); break; case "场地信息ToolStripMenuItem": getSubForm(typeof(Form_PlaceInfo)).Show(); break; case "设备信息ToolStripMenuItem": getSubForm(typeof(Form_DeviceInfo)).Show(); break; case "车辆信息ToolStripMenuItem": getSubForm(typeof(Form_CarInfo)).Show(); break; case "考试员信息ToolStripMenuItem": getSubForm(typeof(Form_ExaminerInfo)).Show(); break; case "驾校信息ToolStripMenuItem": getSubForm(typeof(Form_SchoolInfo)).Show(); break; case "支付定价ToolStripMenuItem": getSubForm(typeof(Form_PricingStrategy)).Show(); break; case "数据库连接设置ToolStripMenuItem": if (form_DBConfig == null || form_DBConfig.IsDisposed) { form_DBConfig = new Form_DBConfig(); } form_DBConfig.ShowDialog(); break; case "参数设置ToolStripMenuItem": new Form_Config().ShowDialog(); break; case "用户管理ToolStripMenuItem": getSubForm(typeof(Form_User)).Show(); break; case "权限管理ToolStripMenuItem": getSubForm(typeof(Form_Permission)).Show(); break; case "日志查询ToolStripMenuItem": getSubForm(typeof(Form_LogQuery)).Show(); break; case "审计查询ToolStripMenuItem": getSubForm(typeof(Form_Audit)).Show(); break; case "操作说明ToolStripMenuItem": if (form_help == null || form_help.IsDisposed) { form_help = new Form_Help(); } form_help.ShowDialog(); break; case "关于ToolStripMenuItem": AboutBox aboutBox = new AboutBox(); aboutBox.ShowDialog(); break; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); LogoutPermissionProcess(); } }