Ejemplo n.º 1
0
        public bool Initialize()
        {
            _setting = new SettingHook();
            try
            {
                _dbConnection          = _setting.GetDatabaseConnectionString();
                _traceabilityIsEnabled = _setting.GetEnableTraceability();
                _machineSerialNumber   = _setting.MachineSerialNumber();
                _uniqueIdLength        = _setting.GetUniqueIdLength();
                _allowCrossWorkOrder   = _setting.GetAllowCrossWorkOrder();
            }
            catch (Exception exception)
            {
                MachineHookException?.Invoke(exception.Message);
                return(false);
            }
            var result = GetMachineBySerialNumber(_machineSerialNumber, _dbConnection, out _thisMachine);

            return(CheckIfInitialized());
        }
Ejemplo n.º 2
0
        private void ReloadSetting()
        {
            _setting = new SettingHook();

            tb_MachineSerialNumber.Text   = _setting.MachineSerialNumber();
            tb_NumberOfStation.Text       = _setting.GetNumberOfStation().ToString();
            tb_UniqueIdentityLength.Text  = _setting.GetUniqueIdLength().ToString();
            cb_EnableTraceability.Checked = _setting.GetEnableTraceability();
            tb_PlcIpAddress.Text          = _setting.GetPlcIpAdress();

            if (_login)
            {
                tb_DbConnectionString.Text = _setting.GetDatabaseConnectionString();
                tb_AdminPassword.Text      = _setting.GetAdminPassword();
            }
            else
            {
                tb_DbConnectionString.Clear();
                tb_AdminPassword.Clear();
            }
        }