Esempio n. 1
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            if (ValidData())
            {
                //Create CategoryModel
                CategoryModel model = new CategoryModel();
                model.CategoryName = CategoryNameValue.Text;

                //Save new category to DB
                GlobalConfig.Connection.CreateCategoryModel(model);

                //Return new category to Book
                callingForm.CategoryComplete(model);

                this.Close();
            }
            else
            {
                MessageBox.Show("Category names cannot be blank and cannot contain commas.", "Incorrect Category Name");
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Exits form
 /// </summary>
 private void ExitFormButton_Click(object sender, EventArgs e)
 {
     callingForm.CategoryComplete(lastCategoryCreated);
     this.Close();
 }