public Boolean deleteCategories(Category oldCategory) { try { this.DataContext.Categories.DeleteOnSubmit(oldCategory); this.DataContext.SubmitChanges(); return true; } catch (Exception) /*FIXME*/ { return false; } }
public Boolean insertCategories(Category newCategory) { try { this.DataContext.Categories.InsertOnSubmit(newCategory); this.DataContext.SubmitChanges(); return true; } catch (Exception) /*FIXME*/ { return false; } }
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; } }
partial void DeleteCategory(Category instance);
partial void UpdateCategory(Category instance);
partial void InsertCategory(Category instance);