| | |
| | | } |
| | | } |
| | | function.roomIdList.Clear(); |
| | | foreach (var room in Entity.DB_ResidenceData.residenceData.rooms) |
| | | foreach (var room in Entity.DB_ResidenceData.rooms) |
| | | { |
| | | if (btnChooseAll.IsSelected) |
| | | { |
| | |
| | | { |
| | | function.roomIdList.Remove(room.sid); |
| | | } |
| | | function.SaveFunctionData(); |
| | | } |
| | | Entity.DB_ResidenceData.InitRoomFunction(); |
| | | Entity.DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | }; |
| | | } |
| | | |
| | |
| | | if (isAdd) |
| | | { |
| | | function.roomIdList.Add(room.sid); |
| | | room.functions.Add(function); |
| | | room.AddRoomFunction(function); |
| | | } |
| | | else |
| | | { |
| | | function.roomIdList.Remove(room.sid); |
| | | room.functions.Remove(function); |
| | | room.RemoveRoomFunction(function); |
| | | } |
| | | Entity.DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | if (function.roomIdList.Count == Entity.DB_ResidenceData.residenceData.rooms.Count) |
| | | function.SaveFunctionData(); |
| | | if (function.roomIdList.Count == Entity.DB_ResidenceData.rooms.Count) |
| | | { |
| | | btnChooseAll.IsSelected = true; |
| | | } |