/// <summary> /// 新增报表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuAddReport_Click(object sender, EventArgs e) { if (TvReport.SelectedNode.Tag != null) { if (TvReport.SelectedNode.Tag.GetType() == typeof(Reportdat)) { MessageBox.Show("报表下边不能添加报表"); return; } HIS.Report_BLL.OpReportMaster _master = (OpReportMaster)TvReport.SelectedNode.Tag; if (_master.REPORTMASTER_ID == -1) { MessageBox.Show("不能直接在根结点下增加报表,请先增加类型"); return; } FrmAddReport report = new FrmAddReport(_master.REPORTMASTER_ID); report.ShowDialog(); if (report.ReportName != "" && report.ProcessName != "") { _currentReport = new Reportdat(); _currentReport.NAME = report.ReportName; _currentReport.PROCEDURES = report.ProcessName; _currentReport.REMARK = report.Remark; _currentReport.REPORTMASTER_ID = _master.REPORTMASTER_ID; _currentReport.addReport(); loadReportdata(); } } }
/// <summary> /// 新增报表类型 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuAddType_Click(object sender, EventArgs e) { if (TvReport.SelectedNode.Tag != null) { if (TvReport.SelectedNode.Tag.GetType() == typeof(Reportdat)) { MessageBox.Show("报表下边不能添加类型"); return; } FrmAddReportType frmtype = new FrmAddReportType(); frmtype.ShowDialog(); if (frmtype.reportTypeName != "") { HIS.Report_BLL.OpReportMaster _master = (OpReportMaster)TvReport.SelectedNode.Tag; _master.NAME = frmtype.reportTypeName; _master.P_ID = _master.REPORTMASTER_ID; _master.REPORT_TYPE = 0; _master.Add(); loadReportdata(); } } }