public String add(session_smcc config) { try { using (var entities = new news_crawlEntities1()) { entities.session_smcc.Add(config); entities.SaveChanges(); return("Thêm Domain thành công"); } } catch (Exception) { return("Thêm Domain thất bại"); } }
public bool delete(int id) { try { using (var entities = new news_crawlEntities1()) { var config = entities.session_smcc.Find(id); if (config != null) { entities.session_smcc.Remove(config); entities.SaveChanges(); return(true); } else { return(false); } } } catch { return(false); } }
public Boolean edit(session_smcc session) { try { using (var entities = new news_crawlEntities1()) { session_smcc sessiontmp = entities.session_smcc.Find(session.Id); if (sessiontmp != null && session != null) { sessiontmp.session = session.session; entities.SaveChanges(); return(true); } else { return(false); } } } catch { return(false); } }