Пример #1
0
 public Boolean deleteCategories(Category oldCategory)
 {
     try
     {
         this.DataContext.Categories.DeleteOnSubmit(oldCategory);
         this.DataContext.SubmitChanges();
         return true;
     }
     catch (Exception) /*FIXME*/
     {
         return false;
     }
 }
Пример #2
0
 public Boolean insertCategories(Category newCategory)
 {
     try
     {
         this.DataContext.Categories.InsertOnSubmit(newCategory);
         this.DataContext.SubmitChanges();
         return true;
     }
     catch (Exception) /*FIXME*/
     {
         return false;
     }
 }
Пример #3
0
 public Boolean editCategories(String oldName, Category newCategory)
 {
     try
     {
         Category editableCategory = this.DataContext.Categories.Single(c => c.Nom == oldName);
         editableCategory.Nom = newCategory.Nom;
         editableCategory.Description = newCategory.Description;
         this.DataContext.SubmitChanges();
         return true;
     }
     catch (Exception) /*FIXME*/
     {
         return false;
     }
 }
Пример #4
0
 partial void DeleteCategory(Category instance);
Пример #5
0
 partial void UpdateCategory(Category instance);
Пример #6
0
 partial void InsertCategory(Category instance);