Example #1
0
 public static ICustomerService GetCustomerService()
 {
     return(new CustomerService(DataAccessFactory.GetCustomerDataAccess()));
 }
Example #2
0
 /// <summary>
 /// 构造
 /// </summary>
 public QCResultDal()
 {
     _sqlHelper = DataAccessFactory.GetSqlDataAccess();
 }
Example #3
0
        public void CreateFeatureDatabase(string directoryPath, string databasePath)
        {
            var directory = GetPath(directoryPath);

            databasePath = GetPath(databasePath);

            // Loads the supported MultiAlign types
            var supportedTypes = DatasetLoader.SupportedFileTypes;
            var extensions     = new List <string>();

            supportedTypes.ForEach(x => extensions.Add("*" + x.Extension));

            // Find our datasets
            var datasetLoader = new DatasetLoader();
            var datasets      = datasetLoader.GetValidDatasets(directory, extensions, SearchOption.TopDirectoryOnly);

            // Options setup
            var instrumentOptions = InstrumentPresetFactory.Create(InstrumentPresets.LtqOrbitrap);
            var featureTolerances = new FeatureTolerances
            {
                Mass      = instrumentOptions.Mass + 6,
                Net       = instrumentOptions.NetTolerance,
                DriftTime = instrumentOptions.DriftTimeTolerance
            };
            var featureFindingOptions = new LcmsFeatureFindingOptions(featureTolerances)
            {
                MaximumNetRange  = .002,
                MaximumScanRange = 50
            };
            var lcmsFilters = new LcmsFeatureFilteringOptions
            {
                FeatureLengthRangeScans = new FilterRange(50, 300)
            };
            var msFilterOptions = new MsFeatureFilteringOptions
            {
                MinimumIntensity           = 5000,
                ChargeRange                = new FilterRange(1, 6),
                ShouldUseChargeFilter      = true,
                ShouldUseDeisotopingFilter = true,
                ShouldUseIntensityFilter   = true
            };
            var spectralOptions = new SpectralOptions
            {
                ComparerType      = SpectralComparison.CosineDotProduct,
                Fdr               = .01,
                IdScore           = 1e-09,
                MzBinSize         = .5,
                MzTolerance       = .5,
                NetTolerance      = .1,
                RequiredPeakCount = 32,
                SimilarityCutoff  = .75,
                TopIonPercent     = .8
            };
            var finder = FeatureFinderFactory.CreateFeatureFinder(FeatureFinderType.TreeBased);

            NHibernateUtil.CreateDatabase(databasePath);
            // Synchronization and IO for serializing all data to the database.
            var providers = DataAccessFactory.CreateDataAccessProviders(databasePath, true);
            var cache     = new FeatureLoader
            {
                Providers = providers
            };

            var datasetId = 0;

            foreach (var dataset in datasets)
            {
                dataset.DatasetId = datasetId++;
                var features = FindFeatures(dataset,
                                            featureFindingOptions,
                                            msFilterOptions,
                                            lcmsFilters,
                                            spectralOptions,
                                            finder);

                cache.CacheFeatures(features);
            }
            providers.DatasetCache.AddAll(datasets);
        }
Example #4
0
 public void SetRegistryFailsWithNull()
 {
     // --- Act
     DataAccessFactory.SetRegistry(null);
 }
Example #5
0
 /// <summary>
 /// 查询自定义SQL
 /// </summary>
 public DataSet SelectSql(string execSql, DbServers.DbServerName currDbName = DbServers.DbServerName.LatestDB)
 {
     return(DataAccessFactory.GetDataProvider(DbServers.GetCurrentDB(currDbName)).GetDataset(execSql));
 }
Example #6
0
        /// <summary>
        /// 提取
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFee_Click(object sender, EventArgs e)
        {
            this.SuspendLayout();
            if (m_App == null || m_App.CurrentPatientInfo == null)
            {
                return;
            }
            IDataAccess sqlHelper = DataAccessFactory.GetSqlDataAccess("HISDB");

            if (sqlHelper == null)
            {
                m_App.CustomMessageBox.MessageShow("无法连接到HIS!", CustomMessageBoxKind.ErrorOk);
                return;
            }
            //to do  yxy 提取HIS数据库中病人费用信息

            #region 注释
            //            string sql = string.Format(@"SELECT     CONVERT(varchar(12), PatCode) AS PatID,FeeCode,
            //                                             CONVERT(varchar(12), FeeName) AS FeeName, CONVERT(float, SUM(Amount)) AS amount
            //                                            FROM  root.InnerRecipeCount WITH (nolock)
            //                                            where PatCode = '{0}'
            //                                            GROUP BY PatCode, FeeName,FeeCode", m_App.CurrentPatientInfo.NoOfHisFirstPage);
            //m_App.CurrentPatientInfo.NoOfHisFirstPage);
            //SqlParameter[] paraColl = new SqlParameter[] { new SqlParameter("@syxh", m_App.CurrentPatientInfo.NoOfHisFirstPage ) };
            //DataTable dataTable = sqlHelper.ExecuteDataTable("usp_bq_fymxcx", paraColl, CommandType.StoredProcedure);

            //将从HIS中提取费用的功能,用从视图中取到,视图名称为:“YD_IEMFEEINFO”
            //************add by ywk 2012年10月8日 12:27:17******************

            //            string hisSql = @"select
            //                        a.zyh as 住院号 ,
            //                        sum(fy) as 总费用,
            //                        b.zfje as 自付金额,
            //                        sum(case fb when 'zl' then fy    --治疗费
            //                              when 'YQ' then fy   --输氧费
            //                              when 'ZZ' then fy   --诊疗费
            //                              when 'JC' then fy   --检查费
            //                              when 'LL' then fy  --理疗费
            //                              when 'JG' then fy  --激光
            //                              when 'WB' then fy  --微波治疗
            //                              when 'YC' then fy  --高压氧舱
            //                              when 'DJ' then fy  --基因检测
            //                              when 'PJ' then fy end ) as 一般治疗操作费,--眼科治疗
            //                        sum(case fb when 'YH' then fy    --婴护费
            //                            when 'TH' then fy     --特护费
            //                            when '1H' then fy    --护理收入
            //                            when 'YF' then fy end ) as 护理费,  --换药费
            //                        sum (case fb when 'XY' then fy end) as 西药费,  --西药费
            //                        sum(case fb when 'ZC' then fy end) as 中成药费,  --中成药费
            //                        sum(case fb when 'ZA' then fy end) as 中草药费,  --中草药费
            //                        sum(case fb when 'SS' then fy     --手术费
            //                            when 'JS' then fy     --接生费
            //                            when 'MS' then fy    --门诊手术
            //                            when 'SP' then fy    --射频手术
            //                            when 'KS' then fy end ) as 手术费,  --科手术
            //                        sum (case fb when 'MZ' then fy end ) as 麻醉费,  --麻醉费
            //                        sum(case fb when 'HY' then fy   --化验费
            //                            when 'JF' then fy end ) as 实验室诊断费,  --检验费
            //                        sum(case fb when 'XG' then fy  --X光
            //                            when 'CT' then fy    --CT费
            //                            when 'BC' then fy    --B超
            //                            when 'CC' then fy    --彩超费
            //                            when 'LD' then fy    --脑电图
            //                            when 'TS' then fy     --透视费
            //                            when 'NT' then fy    --乳透
            //                            when '60' then fy    --胸B超
            //                            when 'HC' then fy     --磁共振
            //                            when 'CB' then fy    --C臂介入
            //                            when 'MB' then fy    --乳腺钼靶
            //                            when 'KB' then fy end ) as  影像学诊断费,  --科B超
            //                        sum (case fb when 'SX' then fy end ) as 输血费,  --输血费
            //                        sum (case fb when 'WJ' then fy  --电子胃镜
            //                            when 'XD' then fy    --心电图
            //                            when 'CX' then fy    --长心电
            //                            when 'DT' then fy    --心动图
            //                            when 'XJ' then fy    --心电监护
            //                            when 'KD' then fy    --科心电图
            //                            when 'PD' then fy end) as 临床诊断,    --潘生心电
            //                        sum(case fb when 'QT'then fy     --其它
            //                            when 'QL' then fy    --取暖费
            //                            when 'JW' then fy end ) as 其它,  --降温费
            //                        sum(case fb when 'WC' then fy end ) as 医用材料费,--医用材料费
            //                        sum (case fb when 'SB' then fy end) as 手术材料费  --手术材料费
            //                        from zybl a left join sfjl b on a.zyh=b.zyh where a.zyh='{0}' group by a.zyh;";
            //string sql = string.Format(hisSql, m_App.CurrentPatientInfo.NoOfHisFirstPage);
            //DataTable dataTable = sqlHelper.ExecuteDataTable(sql, CommandType.Text);
            //if (dataTable == null || dataTable.Rows.Count <= 0) return;
            #endregion
            //仁和医院需求 首页调取费用的方式 0是取视图 1是取存储过程
            DataHelper datahelper = new DataHelper();
            string     GetFeeType = datahelper.GetConfigValueByKey("GetHisMoneyType");
            DataRow    dataRow    = null;
            DataTable  dataTable  = new DataTable();
            DataTable  Dt_FeeInfo = dataTable.Copy();
            if (GetFeeType == "0")
            {
                //add by  ywk 2012年10月8日 12:33:30
                //string sqlView = "select * from YD_IEMFEEINFO";
                //xll 修改 费用提取 2013-04-19
                string sqlView = string.Format("select * from YD_IEMFEEINFO where 住院号='{0}'", m_App.CurrentPatientInfo.NoOfHisFirstPage);
                dataTable = sqlHelper.ExecuteDataTable(sqlView, CommandType.Text);
                if (dataTable == null || dataTable.Rows == null || dataTable.Rows.Count <= 0)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("未提取到该病人的费用信息");
                    return;
                }
                //Dt_FeeInfo = dataTable.Copy();//将所有的费用信息COPY下来,再进行筛选
                //DataRow[] Dr_FeeInfo = Dt_FeeInfo.Select(string.Format("住院号='{0}'", m_App.CurrentPatientInfo.NoOfHisFirstPage));//进行筛选出
                //if (Dr_FeeInfo.Length == 0)
                //{
                //    return;
                //}

                //""的暂时用0.00代替
                dataRow = dataTable.Rows[0];
            }
            if (GetFeeType == "1")//取HIS存储过程
            {
                try
                {
                    //仁和医院的HIS是SQLSERVER版本的  add by ywk 2012年12月17日14:15:45
                    using (SqlConnection conn = new SqlConnection(DataAccessFactory.GetSqlDataAccess("HISDB").GetDbConnection().ConnectionString))
                    {
                        if (conn.State != ConnectionState.Open)
                        {
                            conn.Open();
                        }

                        SqlCommand cmd = conn.CreateCommand();
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.CommandText = "pr_IEMFEEINFO";
                        //SqlD odap = new OracleDataAdapter(cmd);
                        cmd.Parameters.Add("zyh", OracleType.VarChar).Direction = ParameterDirection.Input;//患者住院流水号
                        cmd.Parameters["zyh"].Value = m_App.CurrentPatientInfo.NoOfHisFirstPage;
                        //cmd.ex(cmd.CommandText, cmd.Parameters["zyh"], CommandType.StoredProcedure);
                        SqlDataAdapter odap = new SqlDataAdapter(cmd);
                        DataSet        ds   = new DataSet();
                        odap.Fill(ds);
                        dataTable = ds.Tables[0];
                        dataRow   = ds.Tables[0].Rows[0];
                    }
                    //using (OracleConnection conn = new OracleConnection(DataAccessFactory.GetSqlDataAccess("HISDB").GetDbConnection().ConnectionString))
                    //{
                    //    if (conn.State != ConnectionState.Open)
                    //        conn.Open();

                    //    OracleCommand cmd = conn.CreateCommand();
                    //    cmd.CommandType = CommandType.StoredProcedure;
                    //    cmd.CommandText = "pr_IEMFEEINFO";
                    //    OracleDataAdapter odap = new OracleDataAdapter(cmd);
                    //    cmd.Parameters.Add("zyh", OracleType.VarChar).Direction = ParameterDirection.Input;//患者住院流水号
                    //    cmd.Parameters["zyh"].Value = m_App.CurrentPatientInfo.NoOfHisFirstPage;
                    //    //sqlHelper.ExecuteDataTable(cmd.CommandText, cmd.Parameters["zyh"], CommandType.StoredProcedure);
                    //    DataSet ds = new DataSet();
                    //    odap.Fill(ds);
                    //    dataTable = ds.Tables[0];
                    //    dataRow = ds.Tables[0].Rows[0];
                    //}
                }
                catch (Exception ex)
                {
                    m_App.CustomMessageBox.MessageShow("调用HIS的存储过程报错信息为: " + ex.Message);
                    //throw;
                }
            }


            //DataRow dataRow=dataTable.Rows[0];
            //to do 赋值
            //to do 赋值
            if (dataTable.Columns.Contains("总费用"))
            {
                txtTotal.Text = dataRow["总费用"].ToString();  //总费用
            }

            if (dataTable.Columns.Contains("自付金额"))
            {
                txtOwnFee.Text = dataRow["自付金额"].ToString();  //自付金额
            }

            if (dataTable.Columns.Contains("一般医疗服务费"))
            {
                txtYBYLFY.Text = dataRow["一般医疗服务费"].ToString();  //一般医疗服务费
            }

            if (dataTable.Columns.Contains("一般治疗操作费"))
            {
                txtYBZLFY.Text = dataRow["一般治疗操作费"].ToString();  //一般治疗操作费
            }

            if (dataTable.Columns.Contains("护理费"))
            {
                txtCare.Text = dataRow["护理费"].ToString();        //护理费
            }

            txtZHQTFY.Text = "-";        //其他费用
            if (dataTable.Columns.Contains("病理诊断费"))
            {
                txtBLZDF.Text = dataRow["病理诊断费"].ToString();;         //病理诊断费####
            }
            if (dataTable.Columns.Contains("实验室诊断费"))
            {
                txtSYSZDF.Text = dataRow["实验室诊断费"].ToString();        //实验室诊断费
            }
            if (dataTable.Columns.Contains("影像学诊断费"))
            {
                txtYXXZDF.Text = dataRow["影像学诊断费"].ToString();        //影像学诊断费
            }
            if (dataTable.Columns.Contains("临床诊断"))
            {
                txtLCZDF.Text = dataRow["临床诊断"].ToString(); //临床诊断项目费
            }
            txtFSSZLF.Text  = "-";                          //非手术治疗项目费
            txtLCWLZLF.Text = "-";                          //临床物理治疗费

            float mzf = 0f;
            float ssf = 0f;
            if (dataTable.Columns.Contains("手术费"))
            {
                float.TryParse(dataRow["手术费"].ToString(), out ssf);
            }
            if (dataTable.Columns.Contains("麻醉费"))
            {
                float.TryParse(dataRow["麻醉费"].ToString(), out mzf);
            }

            txtSSZLF.Text = (mzf + ssf).ToString();        //手术治疗费 麻醉费+手术费

            if (dataTable.Columns.Contains("麻醉费"))
            {
                txtMZF.Text = dataRow["麻醉费"].ToString();        //麻醉费
            }
            if (dataTable.Columns.Contains("手术费"))
            {
                txtSSF.Text = dataRow["手术费"].ToString();        //手术费
            }

            if (dataTable.Columns.Contains("康复费"))
            {
                txtKFF.Text = dataRow["康复费"].ToString();        //康复费####
            }
            if (dataTable.Columns.Contains("中医治疗费"))
            {
                txtZYZLF.Text = dataRow["中医治疗费"].ToString();        //中医治疗费####
            }
            if (dataTable.Columns.Contains("西药费"))
            {
                txtXYF.Text = dataRow["西药费"].ToString(); //西药费
            }
            txtKJYWF.Text = "-";                         //抗菌药物费用
            if (dataTable.Columns.Contains("中成药费"))
            {
                txtCPMedical.Text = dataRow["中成药费"].ToString();        //中成药费
            }
            if (dataTable.Columns.Contains("中草药费"))
            {
                txtCMedical.Text = dataRow["中草药费"].ToString();        //中草药费
            }

            if (dataTable.Columns.Contains("输血费"))
            {
                txtBloodFee.Text = dataRow["输血费"].ToString();        //血费
            }


            txtXDBLZPF.Text  = "-";       //白蛋白类制品费
            txtQDBLZPF.Text  = "-";       //球蛋白类制品费
            txtNXYZLZPF.Text = "-";       //凝血因子类制品费

            txtXBYZLZPF.Text = "-";       //细胞因子类制品费
            if (dataTable.Columns.Contains("医用材料费"))
            {
                txtJCYYCXCLF.Text = dataRow["医用材料费"].ToString();        //检查用一次性医用材料费
            }

            txtZLYYCXCLF.Text = "-";        //治疗用一次性医用材料费

            if (dataTable.Columns.Contains("手术材料费"))
            {
                txtSSYYCXCLF.Text = dataRow["手术材料费"].ToString();        //手术用一次性医用材料费
            }
            if (dataTable.Columns.Contains("其它"))
            {
                txtOtherFee.Text = dataRow["其它"].ToString();        //其他费用
            }


            //if (this.FindForm() == null)
            //{
            //    this.Refresh();
            //}
            //else
            //    this.FindForm().Refresh();
        }
Example #7
0
        private void RegisterDataAccessLayers( )
        {
#if (LEADTOOLS_V19_OR_LATER && !TUTORIAL_CUSTOM_DATABASE)
            IStorageDataAccessAgent3 storageAgent;
#else
            IStorageDataAccessAgent storageAgent;
#endif
            ILoggingDataAccessAgent2 loggingAgent;
            //IOptionsDataAccessAgent              optionsAgent ;
            IAeManagementDataAccessAgent         aeManagementAgent;
            IPermissionManagementDataAccessAgent permissionManagementAgent;
            IForwardDataAccessAgent forwardManagementAgent;

#if (LEADTOOLS_V19_OR_LATER_MEDICAL_EXTERNAL_STORE) || (LEADTOOLS_V19_OR_LATER)
            IExternalStoreDataAccessAgent externalStoreAgent;
#endif

#if (LEADTOOLS_V20_OR_LATER)
            IPatientRightsDataAccessAgent2 patientRightsAgent;
#endif


            System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsConfiguration();

#if TUTORIAL_CUSTOM_DATABASE
            // To use a custom database schema, you must create a data access configuration view that implements IDataAccessConfigurationView.
            // This helper class is used to create your custom data access agent.
            // For more details, see the "Changing the LEAD Medical Storage Server to use a different database schema" tutorial.

            storageAgent = DataAccessFactory.GetInstance(new MyStorageDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IStorageDataAccessAgent> ( );
#elif (LEADTOOLS_V19_OR_LATER)
            storageAgent = DataAccessFactory.GetInstance(new StorageDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IStorageDataAccessAgent3> ( );
#else
            storageAgent = DataAccessFactory.GetInstance(new StorageDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IStorageDataAccessAgent> ( );
#endif

            loggingAgent = DataAccessFactory.GetInstance(new LoggingDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <ILoggingDataAccessAgent2>();
            //optionsAgent = DataAccessFactory.GetInstance(new OptionsDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent<IOptionsDataAccessAgent>();
            aeManagementAgent         = DataAccessFactory.GetInstance(new AeManagementDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IAeManagementDataAccessAgent>();
            permissionManagementAgent = DataAccessFactory.GetInstance(new AePermissionManagementDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IPermissionManagementDataAccessAgent>();
            forwardManagementAgent    = DataAccessFactory.GetInstance(new ForwardDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IForwardDataAccessAgent>();
#if (LEADTOOLS_V19_OR_LATER_MEDICAL_EXTERNAL_STORE) || (LEADTOOLS_V19_OR_LATER)
            externalStoreAgent = DataAccessFactory.GetInstance(new ExternalStoreDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IExternalStoreDataAccessAgent>();
#endif

#if (LEADTOOLS_V20_OR_LATER)
            patientRightsAgent = DataAccessFactory.GetInstance(new PatientRightsDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IPatientRightsDataAccessAgent2>();
#endif

            DataAccessServices.RegisterDataAccessService <IStorageDataAccessAgent> (storageAgent);
            DataAccessServices.RegisterDataAccessService <ILoggingDataAccessAgent2> (loggingAgent);
            //DataAccessServices.RegisterDataAccessService<IOptionsDataAccessAgent>(optionsAgent);
            DataAccessServices.RegisterDataAccessService <IAeManagementDataAccessAgent>(aeManagementAgent);
            DataAccessServices.RegisterDataAccessService <IPermissionManagementDataAccessAgent>(permissionManagementAgent);
            DataAccessServices.RegisterDataAccessService <IForwardDataAccessAgent>(forwardManagementAgent);

#if (LEADTOOLS_V19_OR_LATER_MEDICAL_EXTERNAL_STORE) || (LEADTOOLS_V19_OR_LATER)
            DataAccessServices.RegisterDataAccessService <IExternalStoreDataAccessAgent>(externalStoreAgent);
#endif

#if (LEADTOOLS_V20_OR_LATER)
            DataAccessServices.RegisterDataAccessService <IPatientRightsDataAccessAgent2>(patientRightsAgent);
#endif
        }
 public static IUserService GetUserService()
 {
     return(new UserService(DataAccessFactory.GetUserDataAccess()));
 }
 public static ICategoryService GetCategoryService()
 {
     return(new CategoryService(DataAccessFactory.GetCategoryDataAccess()));
 }
Example #10
0
        /// <summary>
        /// 提取
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnFee_Click(object sender, EventArgs e)
        {
            if (m_App == null || m_App.CurrentPatientInfo == null)
            {
                return;
            }
            IDataAccess sqlHelper = DataAccessFactory.GetSqlDataAccess("HISDB");

            if (sqlHelper == null)
            {
                m_App.CustomMessageBox.MessageShow("无法连接到HIS!", CustomMessageBoxKind.ErrorOk);
                return;
            }

            SqlParameter[] paraColl  = new SqlParameter[] { new SqlParameter("@syxh", 26) };
            DataTable      dataTable = sqlHelper.ExecuteDataTable("usp_bq_fymxcx", paraColl, CommandType.StoredProcedure);

            //to do 赋值
            //to do 赋值
            foreach (DataRow row in dataTable.Rows)
            {
                if (row[0].ToString() == "F")
                {
                    return;
                }
                if (row["项目名称"].ToString().Trim() == "其它")
                {
                    lblOthers.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "西药费")
                {
                    lblWMedical.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "治疗费")
                {
                    labelZhiLiao.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "检查费")
                {
                    lblRis.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "检验费")
                {
                    lblAssay.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "诊疗费")
                {
                    lblMecical.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "床位费")
                {
                    lblBed.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "护士护理费")
                {
                    lblCare.Text = row["项目金额"].ToString();
                }
                else if (row["项目名称"].ToString().Trim() == "总计")
                {
                    lblTotal.Text = row["项目金额"].ToString();
                    if (Convertmy.ToDecimal(lblTotal.Text) != 0)
                    {
                        try
                        {
                            lblRate.Text = Convertmy.ToString(Convertmy.ToDecimal(lblWMedical.Text) / Convertmy.ToDecimal(lblTotal.Text) * 100).Substring(0, 2) + "%";
                        }
                        catch
                        {
                            lblRate.Text = "0";
                        }
                    }
                }
                else if (row["项目名称"].ToString().Trim() == "押金累计")
                {
                    row["项目金额"].ToString();
                }
                //费比
            }
        }
Example #11
0
        static void Main()
        {
            // Still want to let this application run with an expired license (as this is an enterprise level application), but in very a limited mode
            // For example, the user should be able to view the log
            //Support.SetLicense();
            //if (Support.KernelExpired)
            //   return;
            InitializeLicense();

            if (ProcessChecker.IsOnlyProcess(Shell.storageServerName))
            {
#if (LEADTOOLS_V20_OR_LATER)
                if (DemosGlobal.IsDotNet45OrLaterInstalled() == false)
                {
                    MessageBox.Show("To run this application, you must first install Microsoft .NET Framework 4.5 or later.",
                                    "Microsoft .NET Framework 4.5 or later Required",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                    return;
                }
#endif
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                PacsProduct.ProductName = DicomDemoSettingsManager.ProductNameStorageServer;

                bool ok;

                string exeName = Path.GetFileNameWithoutExtension(Application.ExecutablePath);

                if (Demos.DemosGlobal.Is64Process( ))
                {
                    exeName += "64";
                }
                else
                {
                    exeName += "32";
                }

                Mutex m = new Mutex(true, exeName, out ok);

#if !TUTORIAL_CUSTOM_DATABASE && !LEADTOOLS_V19_OR_LATER_MEDICAL_EXTERNAL_STORE
                CheckPacsConfigDemo();
#endif

                string globalPacsConfigPath = DicomDemoSettingsManager.GlobalPacsConfigFullFileName;
                if (File.Exists(globalPacsConfigPath))
                {
                    try
                    {
                        if (false == UpgradeConfigFiles())
                        {
                            return;
                        }
                    }
                    catch (Exception ex)
                    {
                        string msg = string.Format("Upgrade Failed!\n\n{0}", ex.Message);
                        MessageBox.Show(msg, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }

                try
                {
                    string   message         = string.Empty;
                    string[] productsToCheck = new string[] { DicomDemoSettingsManager.ProductNameStorageServer };
                    bool     dbConfigured    = GlobalPacsUpdater.IsDbComponentsConfigured(productsToCheck, out message);

#if TUTORIAL_CUSTOM_DATABASE
                    // When manually configuring the storage server to use a different database schema, the helper funciton 'IsDbComponentsConfigured'
                    // will incorrectly detect that the database has not been configured.  In this case, set 'dbConfigured' to true.
                    // For more details, see the "Changing the LEAD Medical Storage Server to use a different database schema" tutorial.
                    dbConfigured = true;
#endif

                    if (!dbConfigured &&
                        !RequestUserToConfigureDbSucess(message))
                    {
                        return;
                    }


#if !TUTORIAL_CUSTOM_DATABASE
                    if (!GlobalPacsUpdater.IsProductDatabaseUpTodate(DicomDemoSettingsManager.ProductNameStorageServer) &&
                        !RequestUserToUpgradeDbSucess( ))
                    {
                        return;
                    }
#endif

                    IOptionsDataAccessAgent            optionsAgent;
                    System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsConfiguration();

                    if (!ok)
                    {
                        return;
                    }

                    optionsAgent = DataAccessFactory.GetInstance(new OptionsDataAccessConfigurationView(configuration, DicomDemoSettingsManager.ProductNameStorageServer, null)).CreateDataAccessAgent <IOptionsDataAccessAgent>();
                    DataAccessServices.RegisterDataAccessService <IOptionsDataAccessAgent>(optionsAgent);

                    if (Login(string.Empty, false))
                    {
//#if !DEBUG
                        SplashForm.ShowSplash();
// #endif
                        Shell shell = new Shell( );

                        shell.Run( );
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("The program failed to run with the following error:\n\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {
#if LEADTOOLS_V19_OR_LATER
                    ProducerConsumerQueue.Instance.Shutdown(true);
#endif
                    m.Close( );
                }
            }
        }
Example #12
0
 public static IPaymentTypeService GetPaymentTypeService()
 {
     return(new PaymentTypeService(DataAccessFactory.GetPaymentTypeDataAccess()));
 }
Example #13
0
 public static IOrderDetailService GetOrderDetailService()
 {
     return(new OrderDetailService(DataAccessFactory.GetOrderDetailDataAccess()));
 }
Example #14
0
 public static IProductService GetProductService()
 {
     return(new ProductService(DataAccessFactory.GetProductDataAccess()));
 }
Example #15
0
        public DbDataReader GetDrawItemDataReader()
        {
            string       sqltxt = "select * from ";
            DbDataReader itemreader;

            if (_itemstyle == DrawItemStyle.LineItem)
            {
                sqltxt = sqltxt + MyTableManage.LineItemTbName + " order by  LineItemOrder ASC";
            }
            else if (_itemstyle == DrawItemStyle.TextItem)
            {
                sqltxt = sqltxt + MyTableManage.TextItemTbName + " order by  TxtItemOrder ASC";
            }
            else if (_itemstyle == DrawItemStyle.ImageItem)
            {
                sqltxt = sqltxt + MyTableManage.ImageItemTbName + " order by  ImageItemOrder ASC";
            }
            else if (_itemstyle.Equals(DrawItemStyle.HCGZItem))
            {
                sqltxt = sqltxt + MyTableManage.HCGZItemTbName + " order by HCGZItemOrder ASC";
            }
            else if (_itemstyle.Equals(DrawItemStyle.MultiHatchCurveItem))
            {
                sqltxt = sqltxt + MyTableManage.MultiCurveHatchTb + " order by ItemOrder ASC";
            }

            else if (_itemstyle.Equals(DrawItemStyle.HatchRectItem))
            {
                sqltxt = sqltxt + MyTableManage.HatchRectItemModelTb + " order by ItemOrder ASC";
            }

            else if (_itemstyle.Equals(DrawItemStyle.CurveHasHatchItem))
            {
                sqltxt = sqltxt + MyTableManage.CurveHasHatchItemModel + " order by ItemOrder ASC";
            }

            else if (_itemstyle.Equals(DrawItemStyle.NormalPuTuItem))
            {
                sqltxt = sqltxt + MyTableManage.NormalPuTuTb + " order by ItemOrder ASC";
            }

            else if (_itemstyle.Equals(DrawItemStyle.SymbolItem))
            {
                sqltxt = sqltxt + MyTableManage.SymbolItemTbName + " order by SymbolOrder ASC";
            }

            else
            {
                sqltxt = "";
                return(null);
            }
            try
            {
                IDataAccess data = DataAccessFactory.CreateDataAccess(DBConfigure.LJJSConfigureDb, DBConfigure.configConStr);
                itemreader = data.ExecuteReader(sqltxt);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                throw ex;
            }
            return(itemreader);
        }
 public static IDeskService GetDeskService()
 {
     return(new DeskService(DataAccessFactory.GetDeskDataAccess()));
 }
        protected override IDbDataParameter[] CreateSelectParameters(EntityBase anEntity)
        {
            ACCESSORIES_DAKHILA_DETAIL theEntity = (ACCESSORIES_DAKHILA_DETAIL)anEntity;
            List <IDbDataParameter>    cmdParams = new List <IDbDataParameter>();

            if (!string.IsNullOrEmpty(theEntity.PK_ID))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_PK_ID", theEntity.PK_ID));
            }

            if (!string.IsNullOrEmpty(theEntity.ACCESSORIES_DAKHILA_ID))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_ACCESSORIES_DAKHILA_ID", theEntity.ACCESSORIES_DAKHILA_ID));
            }

            if (!string.IsNullOrEmpty(theEntity.SNO))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_SNO", theEntity.SNO));
            }

            if (!string.IsNullOrEmpty(theEntity.LFONO))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_LFONO", theEntity.LFONO));
            }

            if (!string.IsNullOrEmpty(theEntity.PRODUCT_ID))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_PRODUCT_ID", theEntity.PRODUCT_ID));
            }

            if (!string.IsNullOrEmpty(theEntity.CATEGORIZATION_NO))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_CATEGORIZATION_NO", theEntity.CATEGORIZATION_NO));
            }

            if (!string.IsNullOrEmpty(theEntity.QUANTITY))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_QUANTITY", theEntity.QUANTITY));
            }

            if (!string.IsNullOrEmpty(theEntity.RATE))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_RATE", theEntity.RATE));
            }

            if (!string.IsNullOrEmpty(theEntity.VAT))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_VAT", theEntity.VAT));
            }

            if (!string.IsNullOrEmpty(theEntity.OTHER_EXPENSE))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_OTHER_EXPENSE", theEntity.OTHER_EXPENSE));
            }

            if (!string.IsNullOrEmpty(theEntity.TOTAL))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_TOTAL", theEntity.TOTAL));
            }

            if (!string.IsNullOrEmpty(theEntity.BATCH))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_BATCH", theEntity.BATCH));
            }

            if (!string.IsNullOrEmpty(theEntity.MANUFACTURER))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_MANUFACTURER", theEntity.MANUFACTURER));
            }

            if (!string.IsNullOrEmpty(theEntity.PRODUCT_SIZE))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_PRODUCT_SIZE", theEntity.PRODUCT_SIZE));
            }

            if (!string.IsNullOrEmpty(theEntity.LIFETIME))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_LIFETIME", theEntity.LIFETIME));
            }

            if (!string.IsNullOrEmpty(theEntity.REMARKS))
            {
                cmdParams.Add(DataAccessFactory.CreateDataParameter("VAR_REMARKS", theEntity.REMARKS));
            }

            cmdParams.Add(DataAccessFactory.CreateDataParameter("Result", ""));

            return(cmdParams.ToArray());
        }
 public static IBorrowService GetBorrowService()
 {
     return(new BorrowService(DataAccessFactory.GetBorrowDataAccess()));
 }
Example #19
0
 public static DataTable Search()
 {
     return(DataAccessFactory.GetDataAccess().SelectDataTable("select * from table_yuyue_day_limit", "tempdb"));
 }
        /// <summary>
        /// 写日志
        /// </summary>
        /// <param name="jobCode"></param>
        /// <param name="logState"></param>
        /// <param name="description"></param>
        public override void WriteLogInternal(string jobCode, string description, Exception ex,
                                              int logCategory, string threadName)
        {
            using (DataAccessBroker broder = DataAccessFactory.Instance())
            {
                string sqlString = "insert into " + TableName
                                   + " ("
                                   + " LOG_DDP_ID"
                                   + " ,JOB_NAME"
                                   + " ,LOG_TIME"

                                   + " ,LOG_TYPE"
                                   + " ,LOG_STATE"
                                   + " ,PHASE"

                                   + " ,DESCRIPTION"
                                   + " ,EXCEPTION_TYPE"
                                   + " ,EXCEPTION_MESSAGE"

                                   + " ,MACHINE_NAME"
                                   + " ,PROCESS_NAME"
                                   + " ,THREAD_NAME"

                                   + " )"

                                   + " values("
                                   + " " + _prefix + "LOG_DDP_ID"
                                   + " ," + _prefix + "JOB_NAME"
                                   + " ," + _prefix + "LOG_TIME"

                                   + " ," + _prefix + "LOG_TYPE"
                                   + " ," + _prefix + "LOG_STATE"
                                   + " ," + _prefix + "PHASE"

                                   + " ," + _prefix + "DESCRIPTION"
                                   + " ," + _prefix + "EXCEPTION_TYPE"
                                   + " ," + _prefix + "EXCEPTION_MESSAGE"

                                   + " ," + _prefix + "MACHINE_NAME"
                                   + " ," + _prefix + "PROCESS_NAME"
                                   + " ," + _prefix + "THREAD_NAME"

                                   + ")";

                DataAccessParameterCollection dpc = new DataAccessParameterCollection();

                ColumnInfo columnInfo = new ColumnInfo("LOG_DDP_ID", "LOG_DDP_ID", true, typeof(string));
                dpc.AddWithValue(columnInfo, Guid.NewGuid().ToString());
                if (jobCode == "")
                {
                    jobCode = " ";
                }
                columnInfo = new ColumnInfo("JOB_NAME", "JOB_NAME", true, typeof(string));
                dpc.AddWithValue(columnInfo, jobCode);
                columnInfo = new ColumnInfo("LOG_TIME", "LOG_TIME", true, typeof(DateTime));
                dpc.AddWithValue(columnInfo, DateTime.Now);

                columnInfo = new ColumnInfo("LOG_TYPE", "LOG_TYPE", true, typeof(int));
                dpc.AddWithValue(columnInfo, Log_Type_Hand);

                columnInfo = new ColumnInfo("LOG_STATE", "LOG_STATE", true, typeof(int));
                dpc.AddWithValue(columnInfo, logCategory);

                columnInfo = new ColumnInfo("PHASE", "PHASE", true, typeof(string));
                dpc.AddWithValue(columnInfo, " ");

                columnInfo = new ColumnInfo("DESCRIPTION", "DESCRIPTION", true, typeof(string));
                dpc.AddWithValue(columnInfo, description);

                if (ex == null)
                {
                    columnInfo = new ColumnInfo("EXCEPTION_TYPE", "EXCEPTION_TYPE", true, typeof(string));
                    dpc.AddWithValue(columnInfo, " ");

                    columnInfo = new ColumnInfo("EXCEPTION_MESSAGE", "EXCEPTION_MESSAGE", true, typeof(string));
                    dpc.AddWithValue(columnInfo, " ");
                }
                else
                {
                    columnInfo = new ColumnInfo("EXCEPTION_TYPE", "EXCEPTION_TYPE", true, typeof(string));
                    dpc.AddWithValue(columnInfo, ex.GetType().ToString());

                    string tempMessage = ex.Message + ex.StackTrace;
                    if (tempMessage.Length > 1999)
                    {
                        tempMessage = tempMessage.Substring(0, 1999);
                    }

                    columnInfo = new ColumnInfo("EXCEPTION_MESSAGE", "EXCEPTION_MESSAGE", true, typeof(string));
                    dpc.AddWithValue(columnInfo, tempMessage);
                }
                columnInfo = new ColumnInfo("MACHINE_NAME", "MACHINE_NAME", true, typeof(string));
                dpc.AddWithValue(columnInfo, Environment.MachineName);
                columnInfo = new ColumnInfo("PROCESS_NAME", "PROCESS_NAME", true, typeof(string));
                dpc.AddWithValue(columnInfo, "eContract.DDP.WindowsService.exe");
                columnInfo = new ColumnInfo("THREAD_NAME", "THREAD_NAME", true, typeof(string));
                dpc.AddWithValue(columnInfo, threadName);
                broder.ExecuteSQL(sqlString, dpc);
            }
        }
Example #21
0
 public void Initialize()
 {
     ServiceManager.SetRegistry(new DefaultServiceRegistry());
     ServiceManager.Register<ITestDataOperations, TestDataOperations>(DB_CONN);
     DataAccessFactory.SetRegistry(ServiceManager.ServiceRegistry);
 }
Example #22
0
 public Enquete()
 {
     db = DataAccessFactory.ObtenirAccesDonnees();
 }
Example #23
0
 /// <summary>
 /// 执行自定义SQL
 /// </summary>
 public void ExecuteSql(string execSql, DbServers.DbServerName currDbName = DbServers.DbServerName.LatestDB)
 {
     DataAccessFactory.GetDataProvider(DbServers.GetCurrentDB(currDbName)).Execute(execSql);
 }
Example #24
0
 public static IEnumerable <Application> GetAllSlim(bool includeArchivedApps)
 {
     return(DataAccessFactory.GetDataInterface <IApplicationData>().GetAllSlim(includeArchivedApps));
 }
Example #25
0
        /// <summary>
        /// 根据Data ID List取数据
        /// </summary>
        /// <returns></returns>
        public DataTable GetSourceByIDList(TableMap tableMap,
                                           string fieldNames,
                                           List <string> dataIDList,
                                           string dataSplitOperator)
        {
            DataTable retTable = new DataTable();

            DataAccessBroker brokerSource = DataAccessFactory.Instance(this.SourceDataAccessCfg);

            try
            {
                for (int x = 0; x < dataIDList.Count;)
                {
                    // 每批50个
                    int count = 50;
                    if (x + count > dataIDList.Count)
                    {
                        count = dataIDList.Count - x;
                    }

                    // 多条数据以or拼起来
                    List <string> tempDataIDList = new List <string>();
                    for (int y = 0; y < count; y++)
                    {
                        tempDataIDList.Add(dataIDList[x + y]);
                    }
                    x += count;

                    // 得到where语句
                    string whereSql = BaseCommand.MakeDataIDWhereSql(fieldNames, tempDataIDList, dataSplitOperator);

                    string sql = "select " + tableMap.SourceTable.FieldNames
                                 + " from " + tableMap.SourceTable.TableName
                                 + whereSql;

                    DataSet dataSet = brokerSource.FillSQLDataSet(sql);
                    if (dataSet == null || dataSet.Tables.Count == 0)
                    {
                        continue;// 继续下一批50
                    }
                    DataTable dtTemp = dataSet.Tables[0];

                    // 第一次时初始化列
                    if (retTable.Columns.Count == 0)
                    {
                        for (int x1 = 0; x1 < dtTemp.Columns.Count; x1++)
                        {
                            retTable.Columns.Add(dtTemp.Columns[x1].ColumnName, dtTemp.Columns[x1].DataType);
                        }
                    }

                    // 将临时表的数据复制到返回的表中
                    for (int i = 0; i < dtTemp.Rows.Count; i++)
                    {
                        DataRow row   = retTable.NewRow();
                        DataRow dtRow = dtTemp.Rows[i];
                        for (int j = 0; j < retTable.Columns.Count; j++)
                        {
                            row[j] = dtRow[j];
                        }
                        retTable.Rows.Add(row);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                brokerSource.Close();
            }

            return(retTable);
        }
Example #26
0
 public static Application GetByName(string name)
 {
     return(DataAccessFactory.GetDataInterface <IApplicationData>().GetByName(name));
 }
Example #27
0
 public EmployeeBusinessLogic()
 {
     _EmployeeDataAccess = DataAccessFactory.GetEmployeeDataAccessObj();
 }
Example #28
0
 public static Application GetById(string id)
 {
     return(DataAccessFactory.GetDataInterface <IApplicationData>().GetById(id));
 }
Example #29
0
        /// <summary>
        /// Initiates the forward process.
        /// </summary>
        private void Forward(string destinationAE)
        {
            try
            {
                IForwardDataAccessAgent      forwardAgent;
                IAeManagementDataAccessAgent aeAgent;

                System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(Module.ServiceDirectory);

                if (!DataAccessServices.IsDataAccessServiceRegistered <IForwardDataAccessAgent>())
                {
                    forwardAgent = DataAccessFactory.GetInstance(new ForwardDataAccessConfigurationView(configuration, null, Module.ServiceName)).CreateDataAccessAgent <IForwardDataAccessAgent>();
                    DataAccessServices.RegisterDataAccessService <IForwardDataAccessAgent>(forwardAgent);
                }
                else
                {
                    forwardAgent = DataAccessServices.GetDataAccessService <IForwardDataAccessAgent>();
                }

                if (!DataAccessServices.IsDataAccessServiceRegistered <IAeManagementDataAccessAgent>())
                {
                    aeAgent = DataAccessFactory.GetInstance(new AeManagementDataAccessConfigurationView(configuration, null, Module.ServiceName)).CreateDataAccessAgent <IAeManagementDataAccessAgent>();
                    DataAccessServices.RegisterDataAccessService <IAeManagementDataAccessAgent>(aeAgent);
                }
                else
                {
                    aeAgent = DataAccessServices.GetDataAccessService <IAeManagementDataAccessAgent>();
                }

                if (forwardAgent != null && aeAgent != null)
                {
                    AeInfoExtended ae = aeAgent.GetAeTitle(destinationAE);

                    if (ae != null)
                    {
#if LEADTOOLS_V20_OR_LATER
                        // Update dbo.AeInfo.LastAccessDate to Date.Now
                        ae.LastAccessDate = DateTime.Now;
                        aeAgent.Update(ae.AETitle, ae);
#endif

                        DicomScp  scp     = null;
                        IPAddress address = IPAddress.None;

                        if (!IPAddress.TryParse(ae.Address, out address))
                        {
                            IPHostEntry host = Dns.GetHostEntry(ae.Address);

                            if (host.AddressList.Length > 0)
                            {
                                address = host.AddressList[0];
                            }
                        }

                        if (address != IPAddress.None)
                        {
                            scp = new DicomScp(address, ae.AETitle, ae.Port)
                            {
                                Timeout = Module.Timeout
                            };

                            new ForwardProcess(Module.Options, Module.ServerAE).Run(scp, forwardAgent);
                        }
                        else
                        {
                            string message = string.Format("[Forwarder] Could resolve host name ({0}) not found on server", ae.Address);

                            Logger.Global.SystemMessage(LogType.Error, message, Module.ServerAE);
                        }
                    }
                    else
                    {
                        string message = string.Format("[Forwarder] AE title ({0}) not found on server", destinationAE);

                        Logger.Global.SystemMessage(LogType.Warning, message, Module.ServerAE);
                    }
                }
            }
            catch (Exception e)
            {
                Logger.Global.SystemMessage(LogType.Error, e.Message, Module.ServerAE);
            }
        }
Example #30
0
 public static IAdminService GetAdminService()
 {
     return(new AdminService(DataAccessFactory.GetAdminDataAccess()));
 }