コード例 #1
0
        /// <summary>
        /// перезагрузка данных на форме
        /// </summary>
        private void ReloadInfo()
        {
            try
            {
                if (_storage == null)
                {
                    throw new Exception("storage settings is missing!");
                }

                labelStorageHeight.Text = _storage.Y.ToString();
                labelStorageWight.Text  = _storage.X.ToString();
                labelStorageDeep.Text   = _storage.Z.ToString();

                labelCargoHeigh.Text = _storage.CargoType.Y.ToString();
                labelCargoWidth.Text = _storage.CargoType.X.ToString();
                labelCargoDeep.Text  = _storage.CargoType.Z.ToString();

                labelMaxCapacity.Text = _storage.CalculateMaxCapacity().ToString();
                labelOccupancy.Text   = _storage.CalculateOccupancy().ToString();
                labelFreeSpace.Text   = _storage.CalculateFreeSpace().ToString();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, ErrorConstants.ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }