private bool create_new_category() { try { category newCat = new category(); newCat.category_name = txtCategoryName.Text; newCat.code = txtCode.Text; newCat.description = txtDescription.Text; newCat.owner = 0; newCat.created_at = DateTime.Now; database.categories.InsertOnSubmit(newCat); database.SubmitChanges(); return true; } catch (Exception newCatError) { MessageBox.Show(newCatError.Message); return false; } }
partial void Updatecategory(category instance);
partial void Deletecategory(category instance);
partial void Insertcategory(category instance);