예제 #1
0
        public override bool ModifyPrintTemplateFieldInfo(string strTemplateGuid, string strTemplateInfo)
        {
            RisDAL dataAccess = new RisDAL();

            string sql = string.Format("Update tPrintTemplate set Version = Version+1  where TemplateGuid = '{0}'", strTemplateGuid);

            byte[] byteTemplateInfo = System.Text.Encoding.Unicode.GetBytes(strTemplateInfo);
            try
            {
                dataAccess.ExecuteNonQuery(sql);
                dataAccess.WriteLargeObj("tPrintTemplate", "TemplateGuid", strTemplateGuid, "TemplateInfo", byteTemplateInfo, byteTemplateInfo.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);
        }
예제 #2
0
        public override string GetUserGuid(string LoginName, string Password, string RoleName)
        {
            StringBuilder strBuilder = new StringBuilder();

            strBuilder.Append("select  tUser.UserGuid ");
            strBuilder.Append("from tUser, tRole2User ");
            strBuilder.Append("where tRole2User.UserGuid = tUser.UserGuid ");
            strBuilder.AppendFormat("and tUser.LoginName = '{0}' and tRole2User.RoleName = '{1}' and tUser.PassWord = '******' ",
                                    LoginName, RoleName, Password);
            strBuilder.Append(" and rownum < 2");
            string rt        = "";
            RisDAL oKodakDAL = new RisDAL();

            try
            {
                rt = Convert.ToString(oKodakDAL.ExecuteScalar(strBuilder.ToString()));
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }

            return(rt);
        }
예제 #3
0
        public override void LogOut(string UserGuid, bool bWebUser)
        {
            StringBuilder strBuilder = new StringBuilder();

            if (bWebUser)
            {
                strBuilder.AppendFormat("Update tOnlineClient Set IsOnline = 0 where UserGuid = '{0}' and (comments = 'web login user')", UserGuid);
            }
            else
            {
                strBuilder.AppendFormat("Update tOnlineClient Set IsOnline = 0 where UserGuid = '{0}' and (comments is null or comments != 'web login user')", UserGuid);
            }
            RisDAL oKodakDAL = new RisDAL();

            try
            {
                oKodakDAL.ExecuteNonQuery(strBuilder.ToString());
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
        }
예제 #4
0
        public override string GetDbServerTime()
        {
            string Cmd = @"Select sysdate from dual";

            string rt        = "";
            RisDAL oKodakDAL = new RisDAL();

            try
            {
                rt = oKodakDAL.ExecuteScalar(Cmd).ToString();
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
            return(rt);
        }
예제 #5
0
        public override int GetOnlineUserNo(bool bWebUser, bool bSelfUser, string ipaddress)
        {
            string Cmd = "";

            if (!bWebUser)
            {
                Cmd = @"Select count(*) from tOnlineClient where IsOnline = 1 and (comments is null or comments != 'web login user') ";
            }
            else
            {
                Cmd = @"Select count(*) from tOnlineClient where IsOnline = 1 and (comments= 'web login user')";
            }

            int    rt        = 0;
            RisDAL oKodakDAL = new RisDAL();

            try
            {
                rt = Convert.ToInt32(oKodakDAL.ExecuteScalar(Cmd));
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
            return(rt);
        }
예제 #6
0
        public override void LogOutBySessionID(string SessionID)
        {
            StringBuilder strBuilder = new StringBuilder();

            strBuilder.AppendFormat("Update tOnlineClient Set IsOnline = 0 where SessionID = '{0}'", SessionID);
            RisDAL oKodakDAL = new RisDAL();

            try
            {
                oKodakDAL.ExecuteNonQuery(strBuilder.ToString());
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
        }
예제 #7
0
        public override DsPanelInfo LoadDsPanelInfo()
        {
            DsPanelInfo m_dsPanelInfo = new DsPanelInfo();
            RisDAL      oKodakDAL     = new RisDAL();

            try
            {
                //string szQuery1 = "SELECT ModuleID, 'Modules.' + ModuleID as Title, Parameter, ImageIndex FROM tModule Where (Parameter & 1) = 0 order by OrderNo";
                string szQuery1 = "SELECT ModuleID,  Title, Parameter, ImageIndex FROM tModule Where (bitand (Parameter , 1) = 0) order by OrderNo";
                oKodakDAL.ExecuteQuery(szQuery1, m_dsPanelInfo, "Module");
                //string szQuery2 = "SELECT PanelID, 'Panels.' + PanelID as Title, AssemblyQualifiedName, Parameter, ModuleID, Flag, ImageIndex, [Key] FROM tPanel Where (Parameter & 1) = 0 order by OrderNo";
                string szQuery2 = "SELECT PanelID,  Title, AssemblyQualifiedName, Parameter, ModuleID, Flag, ImageIndex, Key FROM tPanel Where (bitand (Parameter , 1) = 0) order by OrderNo";
                oKodakDAL.ExecuteQuery(szQuery2, m_dsPanelInfo, "Panel");
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
                m_dsPanelInfo = null;
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
            return(m_dsPanelInfo);
        }
예제 #8
0
        public override bool GetAllProcedureCode(DataSet ds)
        {
            bool      bReturn = true;
            RisDAL    oKodak  = new RisDAL();
            DataTable dt      = new DataTable();

            try
            {
                string strSQL = "SELECT	ProcedureCode,Description,EnglishDescription,ModalityType,BodyPart,CheckingItem,Charge,Preparation,Frequency,BodyCategory,Duration,FilmSpec,FilmCount,ContrastName,ContrastDose,ImageCount,ExposalCount,BookingNotice,ShortcutCode FROM tProcedureCode ";
                dt           = oKodak.ExecuteQuery(strSQL);
                dt.TableName = "ProcedureCode";

                ds.Tables.Add(dt);
                ds.DataSetName = "ProcedureCodeDataSet";
            }
            catch (Exception ex)
            {
                bReturn = false;

                logger.Error((long)ModuleEnum.Register_DA, ModuleInstanceName.Registration, 53, ex.Message, Application.StartupPath.ToString(), (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (oKodak != null)
                {
                    oKodak.Dispose();
                }
            }
            return(bReturn);
        }
예제 #9
0
        public override Server.ClientFramework.Common.Data.Profile.DsConfigDic LoadConfigDic(int Type)
        {
            StringBuilder strBuilder = new StringBuilder();

            strBuilder.Append(
                @"SELECT ConfigName,Value,tConfigDic.ModuleID,
                    tModule.Title as ModuleName,Exportable,
                    nvl(PropertyDesc, '') as PropertyDesc,
                    nvl(PropertyOptions, '') as PropertyOptions,
                    Inheritance,PropertyType,IsHidden,OrderingPos,
                    nvl(Domain, '') as Domain 
                FROM tConfigDic, tModule 
                Where Type= " + Type.ToString() + @" And tModule.ModuleID = tConfigDic.ModuleID");
            RisDAL oKodakDAL = new RisDAL();

            Server.ClientFramework.Common.Data.Profile.DsConfigDic rt =
                new Server.ClientFramework.Common.Data.Profile.DsConfigDic();
            try
            {
                oKodakDAL.ExecuteQuery(strBuilder.ToString(), rt.ConfigDic);
                foreach (DataRow myRow in rt.Tables["ConfigDic"].Rows)
                {
                    if (myRow["Domain"].Equals(DBNull.Value))
                    {
                        myRow["Domain"] = "";
                    }
                    if (myRow["PropertyDesc"].Equals(DBNull.Value))
                    {
                        myRow["PropertyDesc"] = "";
                    }
                    if (myRow["PropertyOptions"].Equals(DBNull.Value))
                    {
                        myRow["PropertyOptions"] = "";
                    }
                    if (myRow["Value"].Equals(DBNull.Value))
                    {
                        myRow["Value"] = "";
                    }
                }
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
            return(rt);
        }
예제 #10
0
        public override DataTable GetBackupFileList(string stTables, bool bFailRetry, string stRetryFlag)
        {
            RisDAL dataAccess = new RisDAL();

            try
            {
                if (bFailRetry == false)
                //get files that have not been downloaded
                {
                    //for requisition
                    string sql = string.Format("select 'trequisition' as tablename, RequisitionGUID as FileGUID, backupmark,backupcomment,filename, relativepath from trequisition where ((backupmark != '1' and backupmark != 'F' )  or backupmark is null )")
                                 //for report files
                                 + string.Format("union ")
                                 + string.Format("select 'treportfile' as tablename, FileGUID,backupmark,backupcomment,filename, relativepath from treportfile where( (backupmark != '1' and backupmark != 'F'  ) or backupmark is null) ")
                                 //for report printlog files
                                 + string.Format("union ")
                                 + string.Format("select 'treportprintlog' as tablename,FileGUID, backupmark,backupcomment,SnapShotSrvPath as filename, null as relativepath from treportprintlog where( (backupmark != '1' and backupmark != 'F' ) or backupmark is null) ");
                    logger.Info((long)ModuleEnum.CommonModule, ModuleInstanceName.CommonModule, 53, sql, Application.StartupPath.ToString(),
                                (new System.Diagnostics.StackFrame(true)).GetFileName(),
                                (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
                    return(dataAccess.ExecuteQuery(sql));
                }
                else
                //get files that fail to download sometime before
                {
                    //for requisition
                    string sql = string.Format("select 'trequisition' as tablename, RequisitionGUID as FileGUID, backupmark,backupcomment,filename, relativepath from trequisition where (backupmark != '1' and len(backupmark)>0)")
                                 //for report files
                                 + string.Format("union ")
                                 + string.Format("select 'treportfile' as tablename, FileGUID,backupmark,backupcomment,filename, relativepath from treportfile where (backupmark != '1' and len(backupmark)>0)")
                                 //for report printlog files
                                 + string.Format("union ")
                                 + string.Format("select 'treportprintlog' as tablename,FileGUID, backupmark,backupcomment,SnapShotSrvPath as filename, null as relativepath from treportprintlog where (backupmark != '1' and len(backupmark)>0)");
                    logger.Info((long)ModuleEnum.CommonModule, ModuleInstanceName.CommonModule, 53, sql, Application.StartupPath.ToString(),
                                (new System.Diagnostics.StackFrame(true)).GetFileName(),
                                (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
                    return(dataAccess.ExecuteQuery(sql));
                }
            }
            catch (Exception ex)
            {
                logger.Error((long)ModuleEnum.CommonModule, ModuleInstanceName.CommonModule, 53, ex.Message, Application.StartupPath.ToString(),
                             (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (dataAccess != null)
                {
                    dataAccess.Dispose();
                }
            }

            return(null);
        }
예제 #11
0
        public string GetAllReportColumn()
        {
            try
            {
                string sql = "select table_name as tblname, column_name as colname,"
                             + " data_type as coltype, data_length as collength"
                             + " from user_tab_cols"
                             + " where table_name in ('TREGPATIENT','TREGORDER', 'TREGPROCEDURE', 'TPROCEDURECODE', 'TREPORT')"
                             + " and column_name not like 'SYS_NC%$' ";

                DataSet ds = new DataSet();

                using (RisDAL dal = new RisDAL())
                {
                    dal.ExecuteQuery(sql, ds, "ReportColumn");

                    if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        string rptCol = "";
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            string alias = ds.Tables[0].Rows[i]["TBLNAME"].ToString() + ReportCommon.ReportCommon.FIELD_SEPERATOR + ds.Tables[0].Rows[i]["COLNAME"].ToString();
                            if (alias.Length > 30)
                            {
                                alias = alias.Substring(0, 30);
                            }

                            rptCol += ds.Tables[0].Rows[i]["TBLNAME"].ToString() + "." + ds.Tables[0].Rows[i]["COLNAME"].ToString() + " as "
                                      + alias + ", ";
                        }

                        rptCol = rptCol.Trim(", ".ToCharArray());

                        if (dal != null)
                        {
                            dal.Dispose();
                        }

                        return(rptCol);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetReportInfoDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return("*");
        }
예제 #12
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);
            }
        }
예제 #13
0
        public object Execute(object param)
        {
            using (RisDAL oKodak = new RisDAL())
            {
                string clsType = string.Format("{0}_{1}", this.GetType().ToString(), oKodak.DriverClassName.ToUpper());
                if (oKodak != null)
                {
                    oKodak.Dispose();
                }

                Type       type    = Type.GetType(clsType);
                IReportDAO iRptDAO = Activator.CreateInstance(type) as IReportDAO;
                return(iRptDAO.Execute(param));
            }
        }
예제 #14
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);
        }
예제 #15
0
        public override bool GetStaff(string strDegreeName, DataSet ds)
        {
            bool      bReturn = true;
            RisDAL    oKodak  = new RisDAL();
            DataTable dt      = new DataTable();

            try
            {
                strDegreeName.Trim();

                string strSQL;
                if (strDegreeName.Length == 0)
                {
                    //throw new Exception("DegreeName must not be null");
                    strSQL = string.Format("Select DISTINCT  tUser.LocalName,tUser.loginname,tUser.UserGuid from tUser where tUser.DeleteMark=0 ", strDegreeName);
                }
                else
                {
                    strSQL = string.Format("Select DISTINCT  tUser.LocalName,tUser.loginname,tUser.UserGuid from tUser,tRole2User where (tUser.DeleteMark=0) and  (tUser.UserGuid=tRole2User.UserGuid) and INSTR((Select Value From tSystemProfile where Name='{0}'),tRole2User.RoleName)>0 ", strDegreeName);
                }


                oKodak.ExecuteQuery(strSQL, dt);
                dt.TableName = "Staff";
                ds.Tables.Add(dt);
            }
            catch (Exception ex)
            {
                bReturn = false;

                logger.Error(100, "CommonFunction", 53, ex.Message, Application.StartupPath.ToString(), new System.Diagnostics.StackFrame(true).GetFileName().ToString(),
                             Convert.ToInt32(new System.Diagnostics.StackFrame(true).GetFileLineNumber().ToString()));
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (oKodak != null)
                {
                    oKodak.Dispose();
                }
            }
            return(bReturn);
        }
예제 #16
0
        public override DsProfile LoadRoleProfile(string ModuleID, string RoleID)
        {
            RisDAL    oKodakDAL = new RisDAL();
            DsProfile m_ds      = new DsProfile();

            try
            {
                string szQuery1 = "select Name, nvl(Value, '') as Value, ModuleID, Exportable, nvl(PropertyDesc, '') as PropertyDesc, nvl(PropertyOptions, '') as PropertyOptions, Inheritance, PropertyType, IsHidden, OrderingPos FROM tRoleProfile " +
                                  " where  (ModuleID = '" + ModuleID + "') and (RoleName = '" + RoleID + "')";
                oKodakDAL.ExecuteQuery(szQuery1, m_ds, "Profile");
                foreach (DataRow myRow in m_ds.Tables["Profile"].Rows)
                {
                    if (myRow["Value"].Equals(DBNull.Value))
                    {
                        myRow["Value"] = "";
                    }
                    if (myRow["PropertyDesc"].Equals(DBNull.Value))
                    {
                        myRow["PropertyDesc"] = "";
                    }
                    if (myRow["PropertyOptions"].Equals(DBNull.Value))
                    {
                        myRow["PropertyOptions"] = "";
                    }
                }
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
                m_ds = null;
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
            return(m_ds);
        }
예제 #17
0
        /// <summary>
        /// Execute
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public object Execute(object param)
        {
            bool bHide0 = ServerPubFun.GetSystemProfile_Bool(ReportCommon.ProfileName.ReportList_HideCount, ReportCommon.ModuleID.Report);
            bool bHide1 = ServerPubFun.GetSystemProfile_Bool(ReportCommon.ProfileName.ReportPrint_HideCount, ReportCommon.ModuleID.Report);

            if (bHide0 && bHide1)
            {
                return(-1);
            }

            using (RisDAL oKodak = new RisDAL())
            {
                string clsType = string.Format("{0}_{1}", this.GetType().ToString(), oKodak.DriverClassName.ToUpper());
                if (oKodak != null)
                {
                    oKodak.Dispose();
                }

                Type       type    = Type.GetType(clsType);
                IReportDAO iRptDAO = Activator.CreateInstance(type) as IReportDAO;
                return(iRptDAO.Execute(param));
            }
        }
예제 #18
0
        public override int IsOnLine(string szUserGuid, string szRoleName, string szIpAddress, string szUrl, string szSessionID, bool IsLogined, bool IsWebAccess, bool IsHijackLogin, bool IsSelfService)
        {
            string Cmd = "";

            int    rt        = 0;
            RisDAL oKodakDAL = new RisDAL();

            try
            {
                if (IsWebAccess == false)
                {
                    oKodakDAL.Parameters.Clear();
                    oKodakDAL.Parameters.AddChar("UserID", szUserGuid);
                    oKodakDAL.Parameters.AddChar("UserRoleName", szRoleName);
                    oKodakDAL.Parameters.AddChar("Url", szUrl);
                    oKodakDAL.Parameters.AddChar("IpAddress", szIpAddress);
                    oKodakDAL.Parameters.AddChar("Session", szSessionID);
                    oKodakDAL.Parameters.AddInt("IsLogined", IsLogined == true ? 1 : 0);
                    oKodakDAL.Parameters.Add("ReturnValue", DbType.Int32);
                    oKodakDAL.Parameters["UserID"].Direction       = ParameterDirection.Input;
                    oKodakDAL.Parameters["UserRoleName"].Direction = ParameterDirection.Input;
                    oKodakDAL.Parameters["Url"].Direction          = ParameterDirection.Input;
                    oKodakDAL.Parameters["IpAddress"].Direction    = ParameterDirection.Input;
                    oKodakDAL.Parameters["Session"].Direction      = ParameterDirection.Input;
                    oKodakDAL.Parameters["IsLogined"].Direction    = ParameterDirection.Input;
                    oKodakDAL.Parameters["ReturnValue"].Direction  = ParameterDirection.Output;
                    oKodakDAL.ExecuteNonQuerySP("checkonline");
                    rt = Convert.ToInt32(oKodakDAL.Parameters["ReturnValue"].Value);
                    //rt = Convert.ToInt32(oKodakDAL.ExecuteScalarSP("checkonline"));
                }
                else
                {
                    oKodakDAL.Parameters.Clear();
                    oKodakDAL.Parameters.AddChar("UserID", szUserGuid);
                    oKodakDAL.Parameters.AddChar("UserRoleName", szRoleName);
                    oKodakDAL.Parameters.AddChar("Url", szUrl);
                    oKodakDAL.Parameters.AddChar("IpAddress", szIpAddress);
                    oKodakDAL.Parameters.AddChar("Session", szSessionID);
                    oKodakDAL.Parameters.Add("ReturnValue", DbType.Int32);
                    oKodakDAL.Parameters["UserID"].Direction       = ParameterDirection.Input;
                    oKodakDAL.Parameters["UserRoleName"].Direction = ParameterDirection.Input;
                    oKodakDAL.Parameters["Url"].Direction          = ParameterDirection.Input;
                    oKodakDAL.Parameters["IpAddress"].Direction    = ParameterDirection.Input;
                    oKodakDAL.Parameters["Session"].Direction      = ParameterDirection.Input;
                    oKodakDAL.Parameters["ReturnValue"].Direction  = ParameterDirection.Output;
                    oKodakDAL.ExecuteNonQuerySP("CHECKWEBONLINE");
                    rt = Convert.ToInt32(oKodakDAL.Parameters["ReturnValue"].Value);
                }
            }
            catch (Exception Ex)
            {
                logger.Error((long)ModuleEnum.Framework_Client, ModuleInstanceName.Framework, 1, Ex.Message,
                             string.Empty, (new System.Diagnostics.StackFrame(true)).GetFileName(),
                             (new System.Diagnostics.StackFrame(true)).GetFileLineNumber());
            }
            finally
            {
                if (oKodakDAL != null)
                {
                    oKodakDAL.Dispose();
                }
            }
            return(rt);
        }
예제 #19
0
        public object Execute(object param)
        {
            try
            {
                Dictionary <string, object> paramMap = param as Dictionary <string, object>;

                if (paramMap == null || paramMap.Count < 1)
                {
                    throw (new Exception("No parameter in GetReportNameDAO!"));
                }

                string reportGuid = "";
                string rpGuids    = "";

                foreach (string key in paramMap.Keys)
                {
                    if (key.ToUpper() == "REPORTGUID")
                    {
                        reportGuid = paramMap[key] as string;

                        if (reportGuid == null)
                        {
                            reportGuid = "";
                        }
                    }
                    else if (key.ToUpper() == "PROCEDUREGUID")
                    {
                        rpGuids = paramMap[key] as string;

                        if (rpGuids == null)
                        {
                            rpGuids = "";
                        }
                    }
                }

                string sql = "select " + GetAllReportColumn()
                             + " from tRegPatient, tRegOrder, tProcedureCode, tRegProcedure "
                             + " left join tReport on tRegProcedure.reportGuid = tReport.reportGuid "
                             + " where tRegPatient.PatientGuid = tRegOrder.PatientGuid "
                             + " and tRegOrder.OrderGuid = tRegProcedure.OrderGuid "
                             + " and tRegProcedure.ProcedureCode = tProcedureCode.ProcedureCode ";

                string sqlFile = " select distinct tReportFile.* from tReportFile, tReport "
                                 + " where tReportFile.reportGuid = tReport.reportGuid ";



                if (reportGuid.Length > 0)
                {
                    sql += " and tReport.reportGuid = '" + reportGuid + "'";

                    sqlFile += " and tReport.reportGuid = '" + reportGuid + "'";
                }

                if (rpGuids.Length > 0 && reportGuid.Length == 0)
                {
                    rpGuids = rpGuids.Trim(", ".ToCharArray());
                    rpGuids = rpGuids.Replace(",", "','");
                    rpGuids = "'" + rpGuids + "'";

                    sql += " and tRegProcedure.ProcedureGuid in (" + rpGuids + ")";

                    sqlFile += " 1!=1";
                }

                DataSet ds = new DataSet();

                using (RisDAL dal = new RisDAL())
                {
                    //
                    // report info
                    DataTable dt0 = new DataTable("ReportInfo");



                    //ServerPubFun.DeclareOracleNoCase();

                    dal.ExecuteQuery(sql, dt0);

                    ds.Tables.Add(dt0);

                    //
                    // report file
                    DataTable dt1 = new DataTable("ReportFile");



                    dal.ExecuteQuery(sqlFile, dt1);

                    ds.Tables.Add(dt1);

                    if (dal != null)
                    {
                        dal.Dispose();
                    }
                }
                return(ds);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetReportInfoDAO=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return(null);
        }
예제 #20
0
        public override bool UpdateEYTemplate(DataSet ds, ref string strError)
        {
            bool   bReturn = true;
            RisDAL oKodak  = new RisDAL();

            try
            {
                List <string> listSQL   = new List <string>();
                DataTable     dt        = ds.Tables["EYTemplate"];
                StringBuilder strBuiler = new StringBuilder();
                foreach (DataRow dr in dt.Rows)
                {
                    string strTemplateName = Convert.ToString(dr["TemplateName"]);
                    string strTemplateGuid = Convert.ToString(dr["TemplateGuid"]);

                    string strSQL = string.Format("SELECT count(*) FROM tEmergencyTemplate where TemplateGuid='{0}'", strTemplateGuid);
                    object obj    = oKodak.ExecuteScalar(strSQL);
                    if (obj == null)
                    {
                        throw new Exception("Unknow error");
                    }
                    int nCount = Convert.ToInt32(obj);
                    if (nCount == 0)
                    {
                        throw new Exception("Can not save due to the template not exists.");
                    }

                    strSQL = string.Format("SELECT count(*) FROM tEmergencyTemplate where TemplateName='{0}' AND TemplateGuid!='{1}'", strTemplateName, strTemplateGuid);
                    obj    = oKodak.ExecuteScalar(strSQL);
                    if (obj == null)
                    {
                        throw new Exception("Unknow error");
                    }
                    nCount = Convert.ToInt32(obj);
                    if (nCount > 0)
                    {
                        throw new Exception("Reduplicate template name");
                    }


                    strBuiler.Remove(0, strBuiler.Length);
                    strBuiler = strBuiler.AppendFormat("UPDATE tEmergencyTemplate SET TemplateName='{0}',NamePrefix='{1}',Birthday=to_date('{2}','YYYY-MM-DD'),Gender='{3}',Telephone='{4}',", Convert.ToString(dr["TemplateName"]), Convert.ToString(dr["NamePrefix"]), Convert.ToDateTime(dr["Birthday"]).ToString("yyyy-MM-dd"), Convert.ToString(dr["GenderValue"]), Convert.ToString(dr["Telephone"]))
                                .AppendFormat("InhospitalNo='{0}',ClinicNo='{1}',BedNo='{2}',ApplyDept='{3}',", dr["InhospitalNo"].ToString(), dr["ClinicNo"].ToString(), dr["BedNo"].ToString(), dr["ApplyDeptValue"].ToString())
                                .AppendFormat("ApplyDoctor='{0}',ProcedureCode='{1}',Description='{2}' WHERE TemplateGuid='{3}'", Convert.ToString(dr["ApplyDoctorValue"]), Convert.ToString(dr["ProcedureCode"]), Convert.ToString(dr["Description"]), Convert.ToString(dr["TemplateGuid"]));

                    listSQL.Add(strBuiler.ToString());

                    string strApplyDept   = Convert.ToString(dr["ApplyDeptValue"]);
                    string strApplyDoctor = Convert.ToString(dr["ApplyDoctorValue"]);
                    strApplyDept = strApplyDept.Trim();
                    if (strApplyDept.Length > 0)
                    {
                        strSQL = string.Format("SELECT count(*) FROM tDictionaryValue WHERE (DictionaryValue='{0}' or Description='{1}') and Tag=2", strApplyDept, strApplyDept);
                        obj    = oKodak.ExecuteScalar(strSQL);
                        if (obj == null)
                        {
                            throw new Exception("Unknow error");
                        }
                        nCount = Convert.ToInt32(obj);
                        if (nCount == 0)
                        {
                            strSQL = string.Format("INSERT INTO tDictionaryValue(Tag,DictionaryValue,Description,shortcutcode) VALUES(2,'{0}','{1}','')", strApplyDept, strApplyDept);
                            listSQL.Add(strSQL);
                        }
                    }

                    strApplyDoctor = strApplyDoctor.Trim();
                    if (strApplyDoctor.Length > 0)
                    {
                        strSQL = string.Format("SELECT count(*) FROM tDictionaryValue WHERE (DictionaryValue='{0}' or Description='{1}') and Tag=8", strApplyDoctor, strApplyDoctor);
                        obj    = oKodak.ExecuteScalar(strSQL);
                        if (obj == null)
                        {
                            throw new Exception("Unknow error");
                        }
                        nCount = Convert.ToInt32(obj);
                        if (nCount == 0)
                        {
                            strSQL = string.Format("INSERT INTO tDictionaryValue(Tag,DictionaryValue,Description,shortcutcode) VALUES(8,'{0}','{1}','')", strApplyDoctor, strApplyDoctor);
                            listSQL.Add(strSQL);
                        }
                    }
                }

                oKodak.BeginTransaction();
                foreach (string strSQL in listSQL)
                {
                    oKodak.ExecuteNonQuery(strSQL, RisDAL.ConnectionState.KeepOpen);
                }
                oKodak.CommitTransaction();
            }
            catch (Exception e)
            {
                strError = e.Message;
                bReturn  = false;
                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()));
            }
            finally
            {
                if (oKodak != null)
                {
                    oKodak.Dispose();
                }
            }
            return(bReturn);
        }
예제 #21
0
        /// <summary>
        /// GetLocalName
        /// </summary>
        /// <param name="userGuid"></param>
        /// <returns></returns>
        public static string GetLocalName(string userGuid)
        {
            try
            {
                if (userGuid != null && (userGuid = userGuid.Trim()).Length > 0)
                {
                    using (RisDAL dal = new RisDAL())
                    {
                        DataTable dt  = new DataTable();
                        string    sql = "";

                        //multi userguid
                        if (userGuid.Length > Guid.NewGuid().ToString().Length)
                        {
                            string tmp = "'" + userGuid.Replace(",", "','") + "'";
                            sql = "select UserGuid,LocalName from tUser where UserGuid in(" + tmp + ")";
                            dal.ExecuteQuery(sql, dt);
                            if (null != dt && dt.Rows.Count > 0)
                            {
                                tmp = "";
                                foreach (string str in userGuid.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
                                {
                                    DataRow[] drs = dt.Select("UserGuid='" + str + "'");
                                    if (drs.Length > 0)
                                    {
                                        tmp += drs[0]["LocalName"].ToString() + ",";
                                    }
                                    else
                                    {
                                        tmp += str + ",";
                                    }
                                }
                                tmp = tmp.TrimEnd(",".ToCharArray());
                                return(tmp);
                            }
                            return("");
                        }
                        else
                        {
                            sql = "select rolename, tUser.userGuid, LoginName, localName, englishname "
                                  + " from tUser, tRole2User"
                                  + " where tUser.UserGuid = tRole2User.UserGuid"
                                  + " and tUser.UserGuid = '" + userGuid + "'";

                            dal.ExecuteQuery(sql, dt);

                            if (dt != null && dt.Rows.Count > 0)
                            {
                                string retName = dt.Rows[0]["LocalName"].ToString();


                                return(retName);
                            }
                        }
                        if (dal != null)
                        {
                            dal.Dispose();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Assert(false, ex.Message);

                ServerPubFun.RISLog_Error(0, "GetLocalName=" + ex.Message,
                                          (new System.Diagnostics.StackFrame()).GetFileName(),
                                          (new System.Diagnostics.StackFrame()).GetFileLineNumber());
            }

            return("");
        }
예제 #22
0
        public override bool AddPrintTemplate(BaseDataSetModel model)
        {
            RisDAL    dataAccess = new RisDAL();
            DataTable myTable    = model.DataSetParameter.Tables[0];
            string    sql        = "Insert into tPrintTemplate(TemplateGuid,Type,TemplateName,IsDefaultByType,Version,ModalityType,IsDefaultByModality) values(:TemplateGuid,:TemplateType,:TemplateName,:IsDefaultByType,0,:ModalityType,:IsDefaultByModality)";

            dataAccess.Parameters.AddChar(":TemplateGuid", myTable.Rows[0]["TemplateGuid"].ToString());
            dataAccess.Parameters.AddInt(":TemplateType", Convert.ToInt32(myTable.Rows[0]["Type"]));
            dataAccess.Parameters.AddChar(":TemplateName", myTable.Rows[0]["TemplateName"].ToString());
            dataAccess.Parameters.AddInt(":IsDefaultByType", Convert.ToInt32(myTable.Rows[0]["IsDefaultByType"]));
            dataAccess.Parameters.AddChar(":ModalityType", Convert.ToString(myTable.Rows[0]["ModalityType"]));
            dataAccess.Parameters.AddInt(":IsDefaultByModality", Convert.ToInt32(myTable.Rows[0]["IsDefaultByModality"]));
            //  string sql1 = string.Format("select TemplateGuid from tPrintTemplate where Type = {0} and IsDefault=1", Convert.ToInt32(myTable.Rows[0]["Type"]));
            byte[] byteTemplateInfo = System.Text.Encoding.Unicode.GetBytes(myTable.Rows[0]["TemplateInfo"].ToString());
            try
            {
                //  if (myTable.Rows[0]["IsDefault"].ToString() == "0")
                //  {

                dataAccess.ExecuteNonQuery(sql);
                dataAccess.WriteLargeObj("tPrintTemplate", "TemplateGuid", myTable.Rows[0]["TemplateGuid"].ToString(), "TemplateInfo", byteTemplateInfo, byteTemplateInfo.Length, RisDAL.ConnectionState.KeepOpen);

                //  }
                //else
                //{

                //    dataAccess.Parameters.Clear();
                //    Object o = dataAccess.ExecuteScalar(sql1);
                //    if (o == null )
                //    {
                //        sql = "Insert into tPrintTemplate(TemplateGuid,Type,TemplateName,TemplateInfo,IsDefault,Version) values(@TemplateGuid,@Type,@TemplateName,@TemplateInfo,@IsDefault,0)";
                //        dataAccess.Parameters.AddVarChar("@TemplateGuid", myTable.Rows[0]["TemplateGuid"].ToString());
                //        dataAccess.Parameters.AddInt("@Type", Convert.ToInt32(myTable.Rows[0]["Type"]));
                //        dataAccess.Parameters.AddVarChar("@TemplateName", myTable.Rows[0]["TemplateName"].ToString());
                //        dataAccess.Parameters.Add("@TemplateInfo", System.Text.Encoding.Default.GetBytes(myTable.Rows[0]["TemplateInfo"].ToString()));
                //        dataAccess.Parameters.AddInt("IsDefault", Convert.ToInt32(myTable.Rows[0]["IsDefault"]));
                //        dataAccess.ExecuteNonQuery(sql);
                //    }
                //    else
                //    {
                //        string strTemplateGuid = o.ToString();
                //        dataAccess.BeginTransaction();
                //        sql = "Insert into tPrintTemplate(TemplateGuid,Type,TemplateName,TemplateInfo,IsDefault,Version) values(@TemplateGuid,@Type,@TemplateName,@TemplateInfo,@IsDefault,0)";
                //        dataAccess.Parameters.AddVarChar("@TemplateGuid", myTable.Rows[0]["TemplateGuid"].ToString());
                //        dataAccess.Parameters.AddInt("@Type", Convert.ToInt32(myTable.Rows[0]["Type"]));
                //        dataAccess.Parameters.AddVarChar("@TemplateName", myTable.Rows[0]["TemplateName"].ToString());
                //        dataAccess.Parameters.Add("@TemplateInfo", System.Text.Encoding.Default.GetBytes(myTable.Rows[0]["TemplateInfo"].ToString()));
                //        dataAccess.Parameters.AddInt("IsDefault", Convert.ToInt32(myTable.Rows[0]["IsDefault"]));

                //        dataAccess.ExecuteNonQuery(sql, KodakDAL.ConnectionState.KeepOpen);
                //        string sql2 = string.Format("Update tPrintTemplate set IsDefault = 0 where TemplateGuid = '{0}'", strTemplateGuid);
                //        dataAccess.ExecuteNonQuery(sql2,KodakDAL.ConnectionState.KeepOpen);

                //        dataAccess.CommitTransaction();
                //    }
                //}
            }
            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);
        }