public bool Update(DormitoryHost obj) { try { _db.SubmitChanges(); } catch (Exception ex) { Debug.Print(ex.Message); return(false); } return(true); }
public int Add(DormitoryHost obj) { try { _db.DormitoryHosts.InsertOnSubmit(obj); _db.SubmitChanges(); } catch (Exception ex) { Debug.Print(ex.Message); return(-1); } return(_db.DormitoryHosts.Max(x => x.DormitoryHostId)); }