private async void timer1_Tick(object sender, EventArgs e) { using (var mgr = new DesignAlternativesOptionsManager(new DesignAlternativesContext())) { var allCategories = await mgr.GetAllCategories(); if (_resetData || allCategories.Count < 1) { try { await mgr.ResetData(); _resetData = false; return; } catch (Exception ex) { MessageBox.Show(ex.Message, "AD-DSS", MessageBoxButtons.OK, MessageBoxIcon.Error); DialogResult = DialogResult.Abort; } } else { DialogResult = DialogResult.OK; } } }
private async void frmSettings_Load(object sender, EventArgs e) { categoryBindingSource.DataSource = await dbMgr.GetAllCategories(); }