private void ButtonAddCategory_Click(object sender, EventArgs e) { if (TextBoxCategories.Text.Length == 0) { LogWarning("New category is empty"); return; } if (m_oWordCategories.InsertTypeGroup(TextBoxCategories.Text)) { UpdateCategoriesList(); TextBoxCategories.Clear(); } TextBoxCategories.Focus(); }
private void ButtonUpdateCategory_Click(object sender, EventArgs e) { if (ListBoxCategories.SelectedItem == null) { LogWarning("Please select a category"); return; } if (TextBoxCategories.Text.Length == 0) { LogWarning("New category name is empty"); return; } String sSelectedTypeGroup = ListBoxCategories.SelectedItem.ToString(); if (m_oWordCategories.UpdateCategory(sSelectedTypeGroup, TextBoxCategories.Text)) { TextBoxCategories.Clear(); UpdateCategoriesList(); } }