Exemplo n.º 1
0
        private void addNewSerialNumber()
        {
            RoomBridge r = new RoomBridge();

            SelectedRoomBridge = r;
            RoomBridges.Add(r);
        }
Exemplo n.º 2
0
        public static List <RoomBridge> GetRoomBridges()
        {
            List <RoomBridge> result = new List <RoomBridge>();

            using (SqlConnection conn = new SqlConnection(Properties.Settings.Default.DatabaseConnString))
            {
                conn.Open();
                string        cmdText = "SELECT * FROM RoomBridges";
                SqlCommand    cmd     = new SqlCommand(cmdText, conn);
                SqlDataReader reader  = cmd.ExecuteReader();
                if (reader.HasRows)
                {
                    logger.Trace("Dicomservers found in database");
                    while (reader.Read())
                    {
                        RoomBridge bridge = new RoomBridge();
                        if (!reader.IsDBNull(reader.GetOrdinal("ID")))
                        {
                            bridge.ID = reader.GetInt32(reader.GetOrdinal("ID"));
                        }

                        if (!reader.IsDBNull(reader.GetOrdinal("RoomID")))
                        {
                            bridge.RoomID = reader.GetInt32(reader.GetOrdinal("RoomID"));
                        }

                        if (!reader.IsDBNull(reader.GetOrdinal("SerialNumber")))
                        {
                            bridge.SerialNumber = reader["SerialNumber"].ToString();
                        }

                        if (!reader.IsDBNull(reader.GetOrdinal("ModelName")))
                        {
                            bridge.ModelName = reader["ModelName"].ToString();
                        }

                        if (bridge.RoomID != 0)
                        {
                            var room = Platform.Retriever.RetrieveItem(bridge.RoomID, typeof(Room));
                            if (room != null)
                            {
                                bridge.Room = room as Room;
                            }
                        }

                        result.Add(bridge);
                    }
                }
                else
                {
                    logger.Warn("No DicomServers found");
                }
            }
            return(result);
        }