예제 #1
0
        public IPXModelBuilder GetBuilder(string language, string path)
        {
            var builder = new PCAxis.Paxiom.PXFileBuilder();

            builder.SetPath(System.IO.Path.Combine($@"wwwroot{Path.DirectorySeparatorChar}db{Path.DirectorySeparatorChar}{ DatabaseId}{Path.DirectorySeparatorChar}", path));
            return(builder);
        }
예제 #2
0
        /// <summary>
        /// Get PxModel object from PX database
        /// </summary>
        /// <param name="dbId">Database id</param>
        /// <param name="language">Language</param>
        /// <param name="tableId">String specifiying the table</param>
        /// <returns>PxModel object for the specified table</returns>
        private PXModel GetPxModel(string dbId, string language, string tableId)
        {
            try
            {
                if (string.IsNullOrEmpty(_pxDatabaseBaseDirectory))
                {
                    throw new System.Exception("PxModelManager has not been INitialized with the PX database base directory");
                }

                string fullPath = System.IO.Path.Combine(_pxDatabaseBaseDirectory, tableId);
                PCAxis.Paxiom.PXFileBuilder builder = new PCAxis.Paxiom.PXFileBuilder();
                builder.SetPath(fullPath);

                builder.SetPreferredLanguage(language);
                builder.BuildForSelection();

                return(builder.Model);
            }
            catch (Exception ex)
            {
                _logger.Error("PCAxis.Search PxModelManager::GetPxModel : " + ex.Message);
            }
            return(null);
        }