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