Example #1
0
        private void UpdateRoom(DataGridViewRow row)
        {
            int id = Convert.ToInt32(row.Cells["id"].Value);

            Room room = Room.GetById(id);

            room.Room_Number   = Convert.ToInt32(row.Cells["room_number"].Value);
            room.Room_Capacity = Convert.ToInt32(row.Cells["room_capacity"].Value);
            room.Price_Per_Day = Convert.ToInt32(row.Cells["price_per_day"].Value);
            room.Floor         = Convert.ToInt32(row.Cells["floor"].Value);
            room.Room_Type     = RoomType.GetById(Convert.ToInt32(row.Cells["room_type_id"].Value));
            room.isEmpty       = Convert.ToBoolean(row.Cells["is_empty"].Value);
            room.Update();
        }