public void Init(IDBQuery dbHelper, ILoginUser loginUser)
 {
     _dbHelper  = dbHelper;
     _loginUser = loginUser;
     _rtm       = new ReportTemplateModel(_dbHelper);
     _comboxEx  = new ComboxEx(dbHelper);
 }
        public frmReportExamConfig(string imgKind, string templateId, IDBQuery dbHelper)
        {
            InitializeComponent();

            _dbHelper   = dbHelper;
            _imgKind    = imgKind;
            _templateId = templateId;

            _eim = new ExamItemModel(dbHelper);
            _rtm = new ReportTemplateModel(dbHelper);
        }
Пример #3
0
        public frmTemplateConstruct(IDBQuery dbHelper, string imgKind)
        {
            InitializeComponent();

            designerControl1 = new DesignerControl();
            panel2.Controls.Add(designerControl1);
            designerControl1.Dock = DockStyle.Fill;

            _dbHelper = dbHelper;
            _imgKind  = imgKind;

            _rwm = new ReportWordsModel(dbHelper);
            _rtm = new ReportTemplateModel(dbHelper);
        }
Пример #4
0
        public void LoadSections()
        {
            _isBinding = true;
            try
            {
                InitList();

                ReportTemplateModel rtm = new ReportTemplateModel(_dbHelper);

                DataTable dtField = rtm.GetSectionNames();

                foreach (DataRow dr in dtField.Rows)
                {
                    string fName = dr["COLUMN_NAME"].ToString();

                    bool   isCheck = false;
                    string eName   = "";
                    string etitle  = "";

                    if (_section.段落关联信息 != null && _section.段落关联信息.Count > 0)
                    {
                        int index = _section.段落关联信息.FindIndex(T => T.报告段落名 == fName);

                        if (index >= 0)
                        {
                            etitle  = _section.段落关联信息[index].段落显示名;
                            eName   = _section.段落关联信息[index].模板元素名;
                            isCheck = _section.段落关联信息[index].关联存储;
                        }
                    }


                    ListViewItem itemNew = new ListViewItem(new string[] { fName, etitle, eName, ((isCheck)? "√" : "") }, 0);

                    itemNew.SubItems[0].Name = "段落名称";
                    itemNew.SubItems[1].Name = "显示名称";
                    itemNew.SubItems[2].Name = "关联元素";
                    itemNew.SubItems[3].Name = "同步保存";


                    listView1.Items.Add(itemNew);
                }

                listView1.View = View.Details;
            }
            finally
            {
                _isBinding = false;
            }
        }
Пример #5
0
        public override bool ModifyReportTemplate(string strTemplateGuid, ReportTemplateModel model)
        {
            RisDAL dataAccess = new RisDAL();

            model.CheckItemName = model.CheckItemName.Replace("'", "''");
            model.DoctorAdvice  = model.DoctorAdvice.Replace("'", "''");
            // model.TechInfo = model.TechInfo.Replace("'", "''");
            // model.WYG = model.WYG.Replace("'", "''");
            // model.WYS =  model.WYS.Replace("'", "''");
            int    mark = 0;
            string sql  = string.Format("Update tReportTemplate set TemplateName='{0}',ModalityType='{1}',BodyPart='{2}',CheckItemName='{3}',DoctorAdvice='{4}',ShortcutCode='{5}',ACRCode='{6}',ACRAnatomicDesc='{7}',ACRPathologicDesc='{8}',BodyCategory='{9}'where TemplateGuid='{10}'",
                                        model.TemplateName, model.ModalityType, model.BodyPart, model.CheckItemName, model.DoctorAdvice, model.ShortcutCode, model.ACRCode, model.ACRAnatomicDesc, model.ACRPathologicDesc, model.BodyCategory, strTemplateGuid);

            byte[] byteWYS        = System.Text.Encoding.Default.GetBytes(model.WYS);
            byte[] byteWYG        = System.Text.Encoding.Default.GetBytes(model.WYG);
            byte[] byteAppendInfo = System.Text.Encoding.Default.GetBytes(model.AppendInfo);
            byte[] byteTechInfo   = System.Text.Encoding.Default.GetBytes(model.TechInfo);

            try
            {
                mark = dataAccess.ExecuteNonQuery(sql);
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "WYS", byteWYS, byteWYS.Length, RisDAL.ConnectionState.CloseOnExit);
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "WYG", byteWYG, byteWYG.Length, RisDAL.ConnectionState.CloseOnExit);
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "AppendInfo", byteAppendInfo, byteAppendInfo.Length, RisDAL.ConnectionState.CloseOnExit);
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "TechInfo", byteTechInfo, byteTechInfo.Length, RisDAL.ConnectionState.CloseOnExit);
            }
            catch (Exception e)
            {
                lm.Error((long)ModuleEnum.Templates_DA, ModuleInstanceName.Templates, 1, e.Message, Application.StartupPath.ToString(),
                         (new System.Diagnostics.StackFrame(true)).GetFileName(),
                         Convert.ToInt32(new System.Diagnostics.StackFrame(true).GetFileLineNumber().ToString()));
                return(false);
            }
            finally
            {
                if (dataAccess != null)
                {
                    dataAccess.Dispose();
                }
            }
            if (mark == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #6
0
        //private BaseActionResult AddReportTemplate(string parameters,ReportTemplateModel model)
        //{
        //    BaseActionResult result = new BaseActionResult();
        //    string strGuid = UC.Utilities.GetParameter("ReportTemplateGUID", parameters);
        //    if (reportTemplateService.AddReportTemplate(strGuid,model))
        //    {
        //        result.Result = true;
        //    }
        //    else
        //    {
        //        result.Result = false;
        //    }

        //    return result;
        //}
        private BaseActionResult ModifyReportTemplate(string parameters, ReportTemplateModel model)
        {
            BaseActionResult result  = new BaseActionResult();
            string           strGUID = UC.Utilities.GetParameter("ReportTemplateGUID", parameters);

            if (reportTemplateService.ModifyReportTemplate(strGUID, model))
            {
                result.Result = true;
            }
            else
            {
                result.Result = false;
            }

            return(result);
        }
Пример #7
0
        private BaseActionResult AddNewLeafNode(ReportTemplateModel model)
        {
            BaseActionResult result = new BaseActionResult();

            //string strItemGuid = Utilities.GetParameter("ItemGuid", parameters).Trim();
            //string strParentID = Utilities.GetParameter("ParentID", parameters).Trim();
            //string strDepth = Utilities.GetParameter("Depth", parameters).Trim();
            //string strItemName = Utilities.GetParameter("ItemName", parameters).Trim();
            //string strItemOrder = Utilities.GetParameter("ItemOrder", parameters).Trim();
            //string strType = Utilities.GetParameter("Type", parameters).Trim();
            //string strUserID = Utilities.GetParameter("UserID", parameters).Trim();
            //string strTemplateGuid = Utilities.GetParameter("TemplateGuid", parameters).Trim();

            if (model == null || model.DirectoryDataSet == null || model.DirectoryDataSet.Tables.Count == 0 || model.DirectoryDataSet.Tables[0].Rows.Count != 1)
            {
                result.Result = false;
                return(result);
            }
            DataTable myTable         = model.DirectoryDataSet.Tables[0];
            string    strItemGuid     = Convert.ToString(myTable.Rows[0]["ItemGuid"]).Trim();
            string    strParentID     = Convert.ToString(myTable.Rows[0]["ParentID"]).Trim();
            string    strDepth        = Convert.ToString(myTable.Rows[0]["Depth"]).Trim();
            string    strItemName     = Convert.ToString(myTable.Rows[0]["ItemName"]).Trim();
            string    strItemOrder    = Convert.ToString(myTable.Rows[0]["ItemOrder"]).Trim();
            string    strType         = Convert.ToString(myTable.Rows[0]["Type"]).Trim();
            string    strUserID       = Convert.ToString(myTable.Rows[0]["UserID"]).Trim();
            string    strTemplateGuid = Convert.ToString(myTable.Rows[0]["TemplateGuid"]).Trim();
            string    strGender       = Convert.ToString(myTable.Rows[0]["Gender"]).Trim();

            if (reportTemplateDirectoryService.AddNewLeafNode(strItemGuid, strParentID, int.Parse(strDepth), strItemName, int.Parse(strItemOrder), int.Parse(strType), strUserID, strTemplateGuid, strGender, model))
            {
                result.Result = true;
            }
            else
            {
                result.Result = false;
            }

            return(result);
        }
Пример #8
0
 public virtual bool AddNewLeafNode(string strItemGuid, string strParentID, int depth, string strItemName, int itemOrder, int type, string strUserID, string strTemplateGuid, string strGender, ReportTemplateModel model)
 {
     return(reportTemplateDAO.AddNewLeafNode(strItemGuid, strParentID, depth, strItemName, itemOrder, type, strUserID, strTemplateGuid, strGender, model));
 }
Пример #9
0
 //public virtual bool AddReportTemplate(string strGuid,ReportTemplateModel model)
 //{
 //    return reportTemplateDAO.AddReportTemplate(strGuid,model);
 //}
 //The follow functions have same comments as commented in AbstractDBProvider
 public virtual bool ModifyReportTemplate(string strTemplateGuid, ReportTemplateModel model)
 {
     return(reportTemplateDAO.ModifyReportTemplate(strTemplateGuid, model));
 }
Пример #10
0
 public static Boolean IsReportTemplateApplied(DateTime?reportDate, ReportTemplateModel template)
 {
     return(reportDate != null && ((reportDate >= template.StartDate && template.EndDate == null) || reportDate >= template.StartDate && reportDate <= template.EndDate));
 }
Пример #11
0
        public override bool AddNewLeafNode(string strItemGuid, string strParentID, int depth, string strItemName, int itemOrder, int type, string strUserID, string strTemplateGuid, string strGender, ReportTemplateModel model)
        {
            RisDAL dataAccess = new RisDAL();

            model.CheckItemName = model.CheckItemName.Replace("'", "''");
            model.DoctorAdvice  = model.DoctorAdvice.Replace("'", "''");
            //model.TechInfo  = model.TechInfo.Replace("'", "''");
            //model.WYG = model.WYG.Replace("'", "''");
            //model.WYS = model.WYS.Replace("'", "''");
            string sql = string.Format("Insert into tReportTemplateDirec(ItemGUID,ParentID,Depth,ItemName,ItemOrder,Type,UserGuid,TemplateGuid,Leaf) values('{0}','{1}',{2},'{3}',{4},{5},'{6}','{7}',{8})"
                                       , strItemGuid, strParentID, depth, strItemName, itemOrder, type, strUserID, strTemplateGuid, 1);
            string sql1 = string.Format("Insert into tReportTemplate(TemplateGuid,TemplateName,ModalityType,BodyPart,CheckItemName,DoctorAdvice,ShortcutCode,ACRCode,ACRAnatomicDesc,ACRPathologicDesc,BodyCategory) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')"
                                        , strTemplateGuid, model.TemplateName, model.ModalityType, model.BodyPart, model.CheckItemName, model.DoctorAdvice, model.ShortcutCode, model.ACRCode, model.ACRAnatomicDesc, model.ACRPathologicDesc, model.BodyCategory);

            try
            {
                dataAccess.BeginTransaction();
                dataAccess.ExecuteNonQuery(sql, RisDAL.ConnectionState.KeepOpen);

                dataAccess.ExecuteNonQuery(sql1, RisDAL.ConnectionState.KeepOpen);
                byte [] byteWYS        = System.Text.Encoding.Default.GetBytes(model.WYS);
                byte [] byteWYG        = System.Text.Encoding.Default.GetBytes(model.WYG);
                byte [] byteAppendInfo = System.Text.Encoding.Default.GetBytes(model.AppendInfo);
                byte [] byteTechInfo   = System.Text.Encoding.Default.GetBytes(model.TechInfo);

                dataAccess.CommitTransaction();
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "WYS", byteWYS, byteWYS.Length, RisDAL.ConnectionState.CloseOnExit);
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "WYG", byteWYG, byteWYG.Length, RisDAL.ConnectionState.CloseOnExit);
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "AppendInfo", byteAppendInfo, byteAppendInfo.Length, RisDAL.ConnectionState.CloseOnExit);
                dataAccess.WriteLargeObj("tReportTemplate", "TemplateGuid", strTemplateGuid, "TechInfo", byteTechInfo, byteTechInfo.Length, RisDAL.ConnectionState.CloseOnExit);
            }
            catch (Exception e)
            {
                lm.Error((long)ModuleEnum.Templates_DA, ModuleInstanceName.Templates, 1, e.Message, Application.StartupPath.ToString(),
                         (new System.Diagnostics.StackFrame(true)).GetFileName(),
                         Convert.ToInt32(new System.Diagnostics.StackFrame(true).GetFileLineNumber().ToString()));
                return(false);
            }
            finally
            {
                if (dataAccess != null)
                {
                    dataAccess.Dispose();
                }
            }

            return(true);
        }