예제 #1
0
        /// <summary>
        /// Method to get register according to register number
        /// </summary>
        /// <param name="register">Register</param>
        /// <param name="registerNumber">Register</param>
        public void SetRegister(ref Register register, short registerNumber)
        {
            var existingRegister = CacheManager.GetRegister(PosId);

            if (existingRegister != null)
            {
                register = existingRegister;
                return;
            }
            var device = new Device();

            LoadDevice(ref device);
            register = _utilityService.SetRegisterInfo(registerNumber, device);
            if (register == null)
            {
                return;
            }
            register.WritePosLog = _utilityService.CanWritePosLog(PosId);
            CacheManager.AddRegister(register, PosId);
        }