public Boolean SaveContact(StibContact stibContact) { StibContactDataContext db = new StibContactDataContext(); stibContact.ID = Guid.NewGuid(); if (!IsValidStibContact(stibContact)) throw new InvalidContactInfoException("Er is niet voldoende informatie om de contactinfo op te slaan."); db.StibContacts.InsertOnSubmit(stibContact); try { db.SubmitChanges(); return true; } catch { return false; } }
public StibContactManager(StibContactDataContext dataContext) { stibContactDataContext = dataContext; }
public StibContactManager() { stibContactDataContext = new StibContactDataContext(); }