Exemple #1
0
        private void btnAddNewExpenseCategory_Click(object sender, EventArgs e)
        {
            string          categoryName = txtExpenseCategoryName.Text;
            string          categoryDesc = txtExpenseCategoryDescription.Text;
            int             catTypeID    = drpCategoryType.SelectedIndex;
            string          catType      = drpCategoryType.SelectedItem.ToString();
            CategoryManager cs           = new CategoryManager(categoryName, categoryDesc, catTypeID, catType);
            bool            res          = cs.AddNewCategory(cs);

            if (res)
            {
                MessageBox.Show("Record Inserted Succesfully.!");
                bindCategory();
                pnlExpenseCategoryGrid.Visible = true;
                pnlExpenseCategoryForm.Visible = false;
            }
            else
            {
                MessageBox.Show("Error.!");
            }
        }
Exemple #2
0
        private void btnAddNewExpenseCategory_Click(object sender, EventArgs e)
        {
            string categoryName = txtExpenseCategoryName.Text;
            string categoryDesc = txtExpenseCategoryDescription.Text;
            int catTypeID = drpCategoryType.SelectedIndex;
            string catType = drpCategoryType.SelectedItem.ToString();
            CategoryManager cs = new CategoryManager(categoryName, categoryDesc, catTypeID, catType);
            bool res = cs.AddNewCategory(cs);

            if (res)
            {
                MessageBox.Show("Record Inserted Succesfully.!");
                bindCategory();
                pnlExpenseCategoryGrid.Visible = true;
                pnlExpenseCategoryForm.Visible = false;
            }
            else
            {
                MessageBox.Show("Error.!");
            }
        }