public Boolean DeleteUserAccount(UserEmployeeModel userEmployeeModel, UserEmployeeDetailModel userEmployeeDetailModel) { geekinsidekmsEntities context = new geekinsidekmsEntities(); UserEmployeeDetail dbDetail = (from detail in context.UserEmployeeDetails where detail.EmployeeNumber == userEmployeeDetailModel.EmployeeNumber select detail).FirstOrDefault(); context.DeleteObject(dbDetail); context.SaveChanges(); UserEmployee dbUser = (from user in context.UserEmployees where user.EmployeeNumber == userEmployeeModel.EmployeeNumber select user).FirstOrDefault(); context.DeleteObject(dbUser); context.SaveChanges(); return true; }
public Boolean deleteFavById(int employeeNumber, int documentId) { geekinsidekmsEntities context = new geekinsidekmsEntities(); DAL.Favorite dbFav = (from fav in context.Favorites where fav.DocumentId.Equals(documentId) && fav.EmployeeNumber.Equals(employeeNumber) select fav).FirstOrDefault(); context.DeleteObject(dbFav); context.SaveChanges(); return true; }
public Boolean deleteNewsById(int id) { geekinsidekmsEntities context = new geekinsidekmsEntities(); DAL.SiteNews dbNews = (from news in context.SiteNews where news.Id.Equals(id) select news).FirstOrDefault(); context.DeleteObject(dbNews); context.SaveChanges(); return true; }
public Boolean deleteDocumentById(int docid) { geekinsidekmsEntities context = new geekinsidekmsEntities(); DAL.Document dbDoc = (from doc in context.Documents where doc.Id.Equals(docid) select doc).FirstOrDefault(); context.DeleteObject(dbDoc); context.SaveChanges(); return true; }