private CacheManager()
        {
            EquipmentDAO equipmentDAO         = DataManager.getEquipmentDAO();
            HelpDAO      helpDAO              = DataManager.getHelpDAO();
            StandardUnitMeasurementDAO sumDAO = DataManager.getStandardUnitMeasurementDAO();
            SignalDAO       signalDAO         = DataManager.getSignalDAO();
            LookupTablesDAO lookupTablesDAO   = DataManager.getLookupTablesDAO();

            loadCacheItem <dbConnector>(equipmentDAO, LuConnectorBean._TABLE_NAME,
                                        "getConnectors", LuConnectorBean._CONNECTOR_TYPE);
            loadCacheItem <LuNamespaceBean>(lookupTablesDAO, LuNamespaceBean._TABLE_NAME,
                                            "getNamespaceLookup", LuNamespaceBean._XMLNS);
            loadCacheItem <HelpMessageBean>(helpDAO, HelpMessageBean._TABLE_NAME,
                                            "getHelpMessages", HelpMessageBean._MESSAGE_KEY);
            loadCacheItem <StandardUnitMeasurementBean>(sumDAO, StandardUnitMeasurementBean._TABLE_NAME,
                                                        "getLimitsActiveStandardUnitMeasurementBeans", StandardUnitMeasurementBean._ID);
            loadCacheItem <StandardUnitPrefixBean>(sumDAO, StandardUnitPrefixBean._TABLE_NAME,
                                                   "getAllStandardUnitPrefixBeans", StandardUnitPrefixBean._ID);
            loadCacheItem <dbSignal>(signalDAO, SignalMasterBean._TABLE_NAME,
                                     "getAllSignals", SignalMasterBean._SIGNAL_ID);
            loadCacheItem <dbSignal>(signalDAO, TestSignalLibraryBean._TABLE_NAME,
                                     "GetAllTsfSignals", SignalMasterBean._SIGNAL_ID);
            loadCacheItem <dbCountry>(lookupTablesDAO, LuCountryBean._TABLE_NAME,
                                      "getActiveCountries", LuCountryBean._COUNTRY_CODE);
            loadCacheItem <DocumentType>(lookupTablesDAO, LuDocumentTypeBean._TABLE_NAME,
                                         "getDocumentTypes", LuDocumentTypeBean._TYPE_ID);
        }
Example #2
0
        public static void ExportMessages()
        {
            HelpDAO dao = new HelpDAO();
            List <HelpMessageBean> messages = dao.getHelpMessages();
            XmlDocument            document = new XmlDocument();
            XmlElement             root     = document.CreateElement("messages");

            document.AppendChild(root);
            foreach (HelpMessageBean messageBean in messages)
            {
                XmlElement message = document.CreateElement("message");
                message.SetAttribute("key", messageBean.messageKey);
                XmlText txt = document.CreateTextNode(messageBean.message);
                message.AppendChild(txt);
                root.AppendChild(message);
            }

            StringWriter sw     = new StringWriter();
            XmlWriter    writer = new UTRSXmlWriter(sw);

            document.WriteContentTo(writer);
            if (FileManager.WriteFile(Encoding.UTF8.GetBytes(sw.ToString()), "help-messages.xml"))
            {
                LogManager.Info("Help Messages have been successfully exported.");
            }
        }
Example #3
0
 private DataManager()
 {
     equpmentDAO = new EquipmentDAO();
     signalDAO   = new SignalDAO();
     helpDAO     = new HelpDAO();
     standardUnitMeasurementDAO = new StandardUnitMeasurementDAO();
     lookupTablesDAO            = new LookupTablesDAO();
     documentDAO = new DocumentDAO();
     schemaDAO   = new SchemaDAO();
 }
 public HomeController(HelpDAO h, RoleDAO r)
 {
     this.helpDAO = h;
     this.roleDAO = r;
 }