public bool DeleteCatePlace(int idCP) { CategoryPlace deleteToCatePlace = (from catePlace in db.CategoryPlace where catePlace.Id == idCP select catePlace).Single(); db.CategoryPlace.DeleteOnSubmit(deleteToCatePlace); db.SubmitChanges(); return(true); }
public bool UpdateCatePlace(CategoryPlace newCategoryPlace) { CategoryPlace categoryPlace = (from catePlace in db.CategoryPlace where catePlace.Id == newCategoryPlace.Id select catePlace).Single(); categoryPlace.Name = newCategoryPlace.Name; categoryPlace.Image = newCategoryPlace.Image; db.SubmitChanges(); return(true); }
// CategoryPlaceService public bool AddCatePlace(CategoryPlace categoryPlace) { try { db.CategoryPlace.InsertOnSubmit(categoryPlace); db.SubmitChanges(); return(true); } catch { return(false); } }