Esempio n. 1
0
        /// <summary>
        /// Get UnStructuce Elements
        /// </summary>
        /// <param name="strDataConnectorType, iDataConnectorID"></param>
        /// <returns></returns>
        //public IList<DiscoveryElementDTO> GetDiscoveryViewModel(string strDataConnectorType,int iDataConnectorID)
        //{
        //    try
        //    {
        //        return GetNonDiscoverElementByConnectorID(strDataConnectorType, iDataConnectorID);
        //    }
        //    catch (ConnectorException conex)
        //    {
        //        throw conex;
        //    }

        //}

        /// <summary>
        /// Getiing the table onformation from the Database nad obix points
        /// </summary>
        /// <param name="strDataConnectorType"></param>
        /// <param name="iDataConnectorID"></param>
        /// <returns>IList<DiscoveryElementDTO></returns>
        public IList <DiscoveryPoint_DTO> GetNonDiscoverElementByConnectorID(int iDataConnectorID)
        {
            ConnectorDTO              objDataConnectorDTO          = _objConectorRepository.GetExistingConnectionById(iDataConnectorID);
            IList <ElementDTO>        strucutredlist               = _objElementRepository.GetElementByConnectionID(iDataConnectorID);
            ExistingConnectionNameDTO objExistingConnectionNameDTO = ExistingConnectionNameDTO.ConvertTableToDTO(objDataConnectorDTO);

            try
            {
                if (objExistingConnectionNameDTO.DataConnectorType == Common.Enums.DataSouceConnectionType.Live)
                {
                    ILiveVariable          obix = new Obix(objDataConnectorDTO.ServerOrIP, objDataConnectorDTO.ServerUserName, objDataConnectorDTO.ServerPassword);
                    IList <LivePointModel> list_of_Live_Point = obix.GetPoints(objDataConnectorDTO.ServerOrIP);
                    return(DiscoveryPoint_DTO_Conversion.ConvertTableToDTO(list_of_Live_Point, objExistingConnectionNameDTO.ConnectionID, objExistingConnectionNameDTO.ConnectionID, strucutredlist).ToList());
                    //return DiscoveryElementDTO.ConvertTableToDTO(list_of_Live_Point, objExistingConnectionNameDTO, strucutredlist).ToList();
                }
                else
                {
                    _objRawTableName.GetRowTableNames(objDataConnectorDTO.ServerOrIP, objDataConnectorDTO.ServerUserName, objDataConnectorDTO.ServerPassword, objDataConnectorDTO.DatabaseName);
                    return(DiscoveryPoint_DTO_Conversion.ConvertTableToDTO(_objRawTableName.RowTableNames, objExistingConnectionNameDTO, strucutredlist).ToList());
                }
            }
            catch (ConnectorException conex)
            {
                throw conex;
            }
        }