Exemplo n.º 1
0
        private async void DBStructureForm_Shown(Object sender, EventArgs e)
        {
            try
            {
                _statusLabel.Text = "Checking...";

                Boolean checkResult = await _storage.CheckDbStructure();

                if (checkResult)
                {
                    _statusLabel.Text    = "Struture is OK";
                    _saveCurrent.Visible = true;
                    _loadBtn.Visible     = true;
                    await ReloadCategories();
                }
                else
                {
                    _initStructureBtn.Visible = true;
                    splitContainer1.Enabled   = false;
                    _statusLabel.Text         = "Struture is not correct. It should be initialized";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.Close();
            }
        }