Пример #1
0
        /// <summary>
        /// 在当前树节点位置处创建目录节点
        /// </summary>
        /// <returns>bool</returns>
        private bool CreateFolder()
        {
            ReportInfoForm templetInfoForm = new ReportInfoForm();

            templetInfoForm.IsNew          = true;
            templetInfoForm.IsFolder       = true;
            templetInfoForm.ReportTypeInfo = this.MakeDocTypeInfo(true);
            if (templetInfoForm.ShowDialog() != DialogResult.OK)
            {
                return(false);
            }

            ReportType reportTypeInfo = templetInfoForm.ReportTypeInfo;

            if (reportTypeInfo == null)
            {
                return(false);
            }
            short shRet = ReportTypeAccess.Instance.Insert(reportTypeInfo);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.ShowError("目录创建失败,无法更新到数据库!");
                return(false);
            }
            return(this.CreateNewNode(true, reportTypeInfo) != null);
        }
Пример #2
0
        /// <summary>
        /// 显示选中的模板的信息,并接受修改
        /// </summary>
        private void ShowTempletInfoEditForm()
        {
            TreeNode selectedNode = this.treeView1.SelectedNode;

            if (selectedNode == null)
            {
                return;
            }
            ReportType reportTypeInfo = selectedNode.Tag as ReportType;

            if (reportTypeInfo == null)
            {
                return;
            }
            string szDocTypeID = reportTypeInfo.ReportTypeID;

            ReportInfoForm templetInfoForm = new ReportInfoForm();

            templetInfoForm.IsNew          = false;
            templetInfoForm.IsFolder       = reportTypeInfo.IsFolder;
            templetInfoForm.ReportTypeInfo = reportTypeInfo.Clone() as ReportType;
            DialogResult result = templetInfoForm.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }

            reportTypeInfo = templetInfoForm.ReportTypeInfo;
            if (reportTypeInfo == null)
            {
                return;
            }
            short shRet = ReportTypeAccess.Instance.Update(reportTypeInfo);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.ShowError("模板创建失败,无法更新到数据库!");
                return;
            }
            selectedNode.Tag  = reportTypeInfo;
            selectedNode.Text = reportTypeInfo.ReportTypeName;
            if (!reportTypeInfo.IsValid)
            {
                selectedNode.ForeColor = Color.Silver;
            }
            else
            {
                selectedNode.ForeColor = Color.Black;
            }

            //List<WardReportType> lstWardReportTypes = templetInfoForm.WardReportTypes;
            //shRet = TempletService.Instance.SaveWardReportTypes(szDocTypeID, lstWardReportTypes);
            //if (shRet != SystemConst.ReturnValue.OK)
            //{
            //    MessageBoxEx.ShowError("模板创建成功,但所属科室信息保存失败!");
            //    return;
            //}
        }
Пример #3
0
        /// <summary>
        /// 在当前树节点位置处创建模板节点
        /// </summary>
        /// <returns>bool</returns>
        private bool CreateDocType()
        {
            ReportInfoForm templetInfoForm = new ReportInfoForm();

            templetInfoForm.IsNew          = true;
            templetInfoForm.IsFolder       = false;
            templetInfoForm.ReportTypeInfo = this.MakeDocTypeInfo(false);
            if (templetInfoForm.ShowDialog() != DialogResult.OK)
            {
                return(false);
            }

            ReportType reportTypeInfo = templetInfoForm.ReportTypeInfo;

            if (reportTypeInfo == null)
            {
                return(false);
            }
            short shRet = ReportTypeAccess.Instance.Insert(reportTypeInfo);

            if (shRet != SystemData.ReturnValue.OK)
            {
                MessageBoxEx.ShowError("模板创建失败,无法更新到数据库!");
                return(false);
            }
            this.CreateNewNode(false, reportTypeInfo);
            ReportHandler.Instance.OpenReport(reportTypeInfo);

            string szDocTypeID = reportTypeInfo.ReportTypeID;

            //List<WardReportType> lstWardReportTypes = templetInfoForm.WardReportTypes;
            //shRet = TempletService.Instance.SaveWardReportTypes(szDocTypeID, lstWardReportTypes);
            //if (shRet != SystemConst.ReturnValue.OK)
            //{
            //    MessageBoxEx.ShowError("模板创建成功,但所属科室信息保存失败!");
            //    return true;
            //}

            return(true);
        }