Exemplo n.º 1
0
        private void InitApplyHISDB()
        {
            DataTable dt;

            try
            {
                //查找对应的HIS数据库配置
                if (_hisServerModel == null)
                {
                    _hisServerModel = new HisServerModel(_dbQuery);
                }

                dt = _hisServerModel.GetAllHisServer();

                //现在版本,先支持一个HIS库,下次迭代修改,再增加同时连接多个HIS库的方式
                HisServerCfgData cfgData = new HisServerCfgData();
                cfgData.BindRowData(dt.Rows[0]);

                ApplyEnum _ae = new ApplyEnum();
                _applyHISDB = _ae.CreateInstance(cfgData.务配置.HIS接口名称) as IApply;
                _applyHISDB.ConfigString = cfgData.务配置.接口配置.ToString();
                _applyHISDB.UserName     = _userData.Name;
                _applyHISDB.Init(_dbQuery);
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }