예제 #1
0
 public bool Update(DormitoryHostBed obj)
 {
     try
     {
         _db.SubmitChanges();
     }
     catch (Exception ex)
     {
         Debug.Print(ex.Message);
         return(false);
     }
     return(true);
 }
예제 #2
0
        public int Add(DormitoryHostBed obj)
        {
            try
            {
                _db.DormitoryHostBeds.InsertOnSubmit(obj);
                _db.SubmitChanges();
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return(-1);
            }

            return(_db.DormitoryHostBeds.Max(x => x.HostBedId));
        }