public bool AddRoomToFloor(string portName, int roomNumber, string roomClass, byte controllerNumber, bool onLine, int roomCategory, bool isProtected) { _logger.Info("service: add floor to port = {0}, controller = {1}, room number = {2}", portName, controllerNumber, roomNumber); FloorsCollection floorsCollection = FloorsCollection.GetInstance(); AlfaEntities alfaEntities = new AlfaEntities(); foreach (Floor floor in floorsCollection) { if (floor.PortName == portName) { Rooms room = new Rooms(); room.FloorId = floor.CurrentFloor.FloorId; room.RoomNumber = roomNumber; room.RoomClass = roomClass; room.ConrollerId = controllerNumber; room.OnLine = onLine; room.RoomCategoriesId = roomCategory; alfaEntities.SaveChanges(); floor.AddRoom(controllerNumber, onLine, isProtected, room.RoomId); } } return false; }
/// <summary> /// Deprecated Method for adding a new object to the Rooms EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRooms(Rooms rooms) { base.AddObject("Rooms", rooms); }
/// <summary> /// Create a new Rooms object. /// </summary> /// <param name="roomId">Initial value of the RoomId property.</param> /// <param name="conrollerId">Initial value of the ConrollerId property.</param> public static Rooms CreateRooms(global::System.Int32 roomId, global::System.Int16 conrollerId) { Rooms rooms = new Rooms(); rooms.RoomId = roomId; rooms.ConrollerId = conrollerId; return rooms; }