private void Save_btn_Click(object sender, EventArgs e)
        {
            // get values from textboxes
            string cat_name = Category_textBox.Text;
            int    cat_id;
            string sub_cat_name = Subcategory_textBox.Text;
            string type_name    = Type_comboBox.SelectedItem.ToString();
            int    type_id      = DB_API.SelectCategoryTypeIdByDesignation(type_name);

            // save new category
            if (!Category_textBox.ReadOnly)
            {
                // verify if field is filled
                if (cat_name.Equals(""))
                {
                    ErrorMessenger.EmptyField("Category");
                    return;
                }

                // verify if new name already exists
                var rdr = DB_API.SelectAccountCategories(account_id);
                while (rdr.Read())
                {
                    if (cat_name.Equals(rdr[DB_API.CategoryEnt.name.ToString()].ToString()))
                    {
                        ErrorMessenger.Error("Category name already exists");
                        return;
                    }
                }

                // add new category
                DB_API.AddCategoryToAccount(account_id, cat_name, type_id);
            }

            // save new sub category
            if (!Subcategory_textBox.ReadOnly)
            {
                cat_id = this.categories[cat_name];

                // verify if field is filled
                if (sub_cat_name.Equals(""))
                {
                    ErrorMessenger.EmptyField("Sub-category");
                    return;
                }

                // verify if new name already exists
                var rdr = DB_API.SelectAccountCategories(account_id);
                while (rdr.Read())
                {
                    if (sub_cat_name.Equals(rdr[DB_API.CategoryEnt.name.ToString()].ToString()))
                    {
                        ErrorMessenger.Error("Category name already exists");
                        return;
                    }
                }

                // add new category
                DB_API.AddSubCategoryToAccount(cat_id, account_id, sub_cat_name, type_id);
            }

            // save new budget
            if (Category_textBox.ReadOnly && Subcategory_textBox.ReadOnly)
            {
                if (Budget_textBox.Text.Equals(""))
                {
                    ErrorMessenger.EmptyField("Monthly Budget");
                    return;
                }

                if (StartMonth_comboBox.SelectedIndex == 0 || EndMonth_comboBox.SelectedIndex == 0)
                {
                    ErrorMessenger.EmptyField("Start month and end month");
                    return;
                }

                cat_id = this.categories[cat_name];
                if (!sub_cat_name.Equals(""))
                {
                    cat_id = this.categories[sub_cat_name];
                }

                double   amount     = DB_API.UnMoneyfy(Budget_textBox.Text);
                int      startMonth = StartMonth_comboBox.SelectedIndex;
                int      startYear  = (int)StartYear_numericBox.Value;
                int      endMonth   = EndMonth_comboBox.SelectedIndex;
                int      endYear    = (int)EndYear_numericBox.Value;
                DateTime startDate  = DateTime.Parse(startYear + "/" + startMonth + "/01");
                DateTime endDate;

                if (endMonth == 2)
                {
                    endDate = DateTime.Parse(endYear + "/" + endMonth + "/28");
                }
                else
                {
                    endDate = DateTime.Parse(endYear + "/" + endMonth + "/30");
                }

                // verify that endaDate is bigger than startDate
                if (startDate.CompareTo(endDate) > 0)
                {
                    ErrorMessenger.InvalidData("End date");
                    return;
                }

                // insert new budget
                DB_API.InsertBudget(account_id, cat_id, amount, startDate, endDate);
            }

            PopulateCategoriesListBox();
        }