/// <summary> /// 호실정보 수정 /// </summary> private void UpdateRoomStatusItem() { DataTable roomDataTable = dbc.GetRoomList(selectGroupCode, null); foreach (Control control in this.top_room_panel.Controls) { if (control is UC_RoomStatusItem) { UC_RoomStatusItem roomControl = control as UC_RoomStatusItem; string controlRoomCode = roomControl.GetRoomCode(); string groupCode = ""; string roomCode = ""; string roomName = ""; string roomStatus = ""; foreach (DataRow row in roomDataTable.Rows) { if (controlRoomCode.Equals(row["room_code"].ToString())) { groupCode = row["group_code"].ToString(); roomCode = row["room_code"].ToString(); roomName = row["room_name"].ToString(); roomStatus = row["room_status"].ToString(); } } roomControl.UpdateRoomStatusItem(groupCode, roomCode, roomName, roomStatus); } } foreach (Control control in this.bottom_room_panel.Controls) { if (control is UC_RoomStatusItem) { UC_RoomStatusItem roomControl = control as UC_RoomStatusItem; string controlRoomCode = roomControl.GetRoomCode(); string groupCode = ""; string roomCode = ""; string roomName = ""; string roomStatus = ""; foreach (DataRow row in roomDataTable.Rows) { if (controlRoomCode.Equals(row["room_code"].ToString())) { groupCode = row["group_code"].ToString(); roomCode = row["room_code"].ToString(); roomName = row["room_name"].ToString(); roomStatus = row["room_status"].ToString(); } } roomControl.UpdateRoomStatusItem(groupCode, roomCode, roomName, roomStatus); } } }
/// <summary> /// 호실 상태정보 수정 및 UserController 수정 /// </summary> /// <param name="groupCode">사동코드</param> /// <param name="roomCode">호실코드</param> /// <param name="roomStatus">문상태</param> /// <returns>호실 정보</returns> private JObject UpdateRoomStatusItemBySensor(string groupCode, string roomCode, string roomStatus) { DataTable roomDataTable = dbc.UpdateRoomStatus(groupCode, roomCode, roomStatus); UC_RoomStatusItem roomControl = null; foreach (Control control in this.top_room_panel.Controls) { if (control is UC_RoomStatusItem) { UC_RoomStatusItem temp = control as UC_RoomStatusItem; string UC_GroupCode = temp.GetGroupCode(); string UC_RoomCode = temp.GetRoomCode(); if (UC_GroupCode.Equals(groupCode) && UC_RoomCode.Equals(roomCode)) { roomControl = control as UC_RoomStatusItem; } } } foreach (Control control in this.bottom_room_panel.Controls) { if (control is UC_RoomStatusItem) { UC_RoomStatusItem temp = control as UC_RoomStatusItem; string UC_GroupCode = temp.GetGroupCode(); string UC_RoomCode = temp.GetRoomCode(); if (UC_GroupCode.Equals(groupCode) && UC_RoomCode.Equals(roomCode)) { roomControl = control as UC_RoomStatusItem; } } } if (roomControl != null) { roomControl.RoomColorChange(roomStatus); } DataRow[] rows = roomDataTable.Select(); JObject json = new JObject(); json.Add("groupCode", rows[0]["group_code"].ToString()); json.Add("groupName", rows[0]["group_name"].ToString()); json.Add("roomName", rows[0]["room_name"].ToString()); json.Add("roomCode", rows[0]["room_code"].ToString()); json.Add("roomStatus", rows[0]["room_status"].ToString()); json.Add("roomStatusName", rows[0]["room_status_name"].ToString()); json.Add("updatTime", rows[0]["updat_time"].ToString()); json.Add("preset", rows[0]["preset"].ToString()); return(json); }