Beispiel #1
0
        private void CreateCategory()
        {
            if (NewCatName.Text.Length > 250)
            {
                MessageBox.Show("Category name is too long!");
            }
            else if (NewCatName.Text != "")
            {
                using (IdeasContext ctx = new IdeasContext(IdeasContext.ConnectionString))
                {
                    ctx.CreateIfNotExists();

                    var category = new Categories() { Name = NewCatName.Text };

                    ctx.Categories.InsertOnSubmit(category);
                    ctx.SubmitChanges();

                    NavigationService.GoBack();

                }
            }
        }
Beispiel #2
0
 partial void UpdateCategories(Categories instance);
Beispiel #3
0
 partial void DeleteCategories(Categories instance);
Beispiel #4
0
 partial void InsertCategories(Categories instance);