示例#1
0
        public void Edit(RoomDTO roomDTO)
        {
            Room_Numbers room = new Room_Numbers();

            room.Room_NumberID          = roomDTO.Room_NumberID;
            room.Room_Type              = roomDTO.Room_Type;
            dbcontext.Entry(room).State = EntityState.Modified;
            dbcontext.SaveChanges();
        }
示例#2
0
 public bool Delete(int id)
 {
     if (dbcontext.Room_Numbers.Any(r => r.Room_NumberID == id))
     {
         Room_Numbers room = new Room_Numbers();
         room.Room_NumberID          = id;
         dbcontext.Entry(room).State = EntityState.Deleted;
         dbcontext.SaveChanges();
         return(true);
     }
     else
     {
         return(false);
     }
 }