public bool Delete(long id) { try { var doc = new DocumentDao().ListAll(id); foreach (var item in doc) { new DocumentDao().Delete(item.ID); } var cate = db.DocumentCategories.Find(id); db.DocumentCategories.Remove(cate); db.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public int Insert(Feedback entity) { db.Feedbacks.Add(entity); db.SaveChanges(); return(entity.ID); }
public long Insert(User entity) { db.Users.Add(entity); db.SaveChanges(); return(entity.ID); }
public long Insert(Document entity) { db.Documents.Add(entity); db.SaveChanges(); return(entity.ID); }