Exemple #1
0
        private void SaveItem(object sender, System.EventArgs e)
        {
            DB db = new DB();

            if (this.WhatIs == "category")
            {
                db.AddCategoryItem(this.ParentID, this.textBox_CategoryName.Text);
            }
            if (this.WhatIs == "author")
            {
                db.AddAuthorItem(this.ParentID, this.textBox_FirstName.Text, this.textBox_LastName.Text);
            }
            if (this.WhatIs == "book")
            {
                db.AddBookItem(this.ParentID, this.textBox_BookTitle.Text, int.Parse(this.bookGenres[this.comboBox_BD_Genres.SelectedItem.ToString()].ToString()));
            }
            ((RooBooks)this.parentForm).contextMenu_Categories_Refresh_Click(null, null);
            this.Close();
        }