Beispiel #1
0
        public void Init(IDBQuery dbHelper, ILoginUser loginUser)
        {
            _dbHelper  = dbHelper;
            _loginUser = loginUser;

            _pm  = new ParameterModel(dbHelper);
            _scm = new StationConfigModel(_dbHelper);
            _dmm = new DictManageModel(dbHelper);
            _departmentMatchModel = new DepartmentMatchModel(dbHelper);
            _depRoomModel         = new DepRoomModel(dbHelper);
            _depDeviceModel       = new DepDeviceModel(dbHelper);
            _storageModel         = new StorageModel(dbHelper);
        }
        /// <summary>
        /// 获取本机站点信息
        /// </summary>
        /// <param name="dbHelper"></param>
        /// <returns></returns>
        static public StationInfo GetLocateStationInfo(string serverName, IDBProvider dbHelper)
        {
            StationConfigModel scm = new StationConfigModel(dbHelper);

            if (scm == null)
            {
                return(null);
            }

            JStationConfig stationConfig = scm.GetStationInfo(Dns.GetHostName());

            if (stationConfig == null)
            {
                return(null);
            }

            StationInfo si = new StationInfo();

            si.DBServerName = serverName;
            si.DistrictCode = stationConfig.当前院区编码;

            si.DepartmentId   = stationConfig.站点所属科室;
            si.DepartmentName = scm.GetDepartmentNameById(si.DepartmentId);

            si.RoomId   = stationConfig.站点所属房间;
            si.RoomName = scm.GetRoomNameById(si.RoomId);

            si.DeviceId   = stationConfig.当前检查设备;
            si.DeviceName = scm.GetDeviceNameById(si.DeviceId);

            si.StorageId   = stationConfig.当前存储设备;
            si.StorageName = scm.GetStorageNameById(si.StorageId);

            si.StationName = Dns.GetHostName();

            return(si);
        }