private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         AddCategoryBilling addCategoryForm = new AddCategoryBilling(_views);
         addCategoryForm.ShowDialog();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (_displayMode == DisplayMode.Default)
                {
                    var addCategoryForm = new AddCategory(_views);

                    if (addCategoryForm.ShowDialog() == DialogResult.OK)
                    {
                        FillCategories();

                        if (addCategoryForm.SelectedCategoryID != null)
                        {
                            SelectByCategoryID(addCategoryForm.SelectedCategoryID.Value);
                        }
                    }
                }
                else if (_displayMode == DisplayMode.Billing)
                {
                    var addCategoryForm = new AddCategoryBilling(_views);
                    if (addCategoryForm.ShowDialog() == DialogResult.OK)
                    {
                        FillCategories();

                        if (addCategoryForm.SelectedCategoryID != null)
                        {
                            SelectByCategoryID(addCategoryForm.SelectedCategoryID.Value);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }