public questStatus Read(DbMgrTransaction trans, DatabaseId databaseId, out List <Quest.Functional.MasterPricing.StoredProcedure> storedProcedureList)
        {
            // Initialize
            questStatus status = null;

            storedProcedureList = null;


            // Perform read
            List <Quest.Services.Dbio.MasterPricing.StoredProcedures> _storedProceduresList = null;

            status = read((MasterPricingEntities)trans.DbContext, databaseId, out _storedProceduresList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            storedProcedureList = new List <StoredProcedure>();
            foreach (Quest.Services.Dbio.MasterPricing.StoredProcedures _storedProcedure in _storedProceduresList)
            {
                Quest.Functional.MasterPricing.StoredProcedure storedProcedure = new Quest.Functional.MasterPricing.StoredProcedure();
                BufferMgr.TransferBuffer(_storedProcedure, storedProcedure);
                storedProcedureList.Add(storedProcedure);
            }
            return(new questStatus(Severity.Success));
        }
Example #2
0
        public questStatus GetViewInfo(DatabaseId databaseId, TablesetView tablesetView, out View view)
        {
            // Initialize
            questStatus status = null;

            view = null;


            // Get view
            DbViewsMgr dbViewsMgr = new DbViewsMgr(this._userSession);

            status = dbViewsMgr.Read(databaseId, tablesetView.Schema, tablesetView.Name, out view);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            tablesetView.View = view;


            // Get view columns
            ViewId        viewId       = new ViewId(view.Id);
            List <Column> columnList   = null;
            DbColumnsMgr  dbColumnsMgr = new DbColumnsMgr(this._userSession);

            status = dbColumnsMgr.Read(viewId, out columnList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            view.ColumnList = columnList;

            return(new questStatus(Severity.Success));
        }
Example #3
0
        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus GetDatabase(DatabaseId databaseId, out DatabaseBaseViewModel databaseBaseViewModel)
        {
            // Initialize
            questStatus status = null;

            databaseBaseViewModel = null;


            // Read the database
            Quest.Functional.MasterPricing.Database database = null;
            DatabasesMgr databasesMgr = new DatabasesMgr(this.UserSession);

            status = databasesMgr.Read(databaseId, out database);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Transfer model.
            databaseBaseViewModel = new DatabaseBaseViewModel(this.UserSession);
            BufferMgr.TransferBuffer(database, databaseBaseViewModel);
            databaseBaseViewModel.LastRefresh = database.LastRefresh.HasValue ?
                                                database.LastRefresh.Value.ToString("MM/dd/yyyy HH:mm:ss") : "";

            return(new questStatus(Severity.Success));
        }
Example #4
0
        public questStatus GetDatabaseViews(DatabaseId databaseId, out List <BootstrapTreenodeViewModel> dbViewNodeList)
        {
            // Initialize
            questStatus status = null;

            dbViewNodeList = null;


            // Get db tables
            List <DBTable> dbTableList = null;
            DatabaseMgr    databaseMgr = new DatabaseMgr(this.UserSession);

            status = databaseMgr.GetDatabaseTables(databaseId, out dbTableList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Format into bootstrap nodes
            dbViewNodeList = new List <BootstrapTreenodeViewModel>();
            foreach (DBTable dbTable in dbTableList)
            {
                BootstrapTreenodeViewModel bootstrapTreenodeViewModel = null;
                status = FormatBootstrapTreeviewNode(dbTable, out bootstrapTreenodeViewModel);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                dbViewNodeList.Add(bootstrapTreenodeViewModel);
            }
            return(new questStatus(Severity.Success));
        }
Example #5
0
 public Database(DatabaseId id, DatabaseType type, string humanName, string tnsName)
 {
     Id        = id;
     Type      = type;
     HumanName = humanName;
     TnsName   = tnsName;
 }
Example #6
0
        public questStatus Read(DatabaseId databaseId, out List <Quest.Functional.MasterPricing.Table> tableList)
        {
            // Initialize
            questStatus status = null;

            tableList = null;


            // Perform read
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                List <Quest.Services.Dbio.MasterPricing.Tables> _tableList = null;
                status = read(dbContext, databaseId, out _tableList);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                tableList = new List <Table>();
                foreach (Quest.Services.Dbio.MasterPricing.Tables _table in _tableList)
                {
                    Quest.Functional.MasterPricing.Table table = new Table();
                    BufferMgr.TransferBuffer(_table, table);
                    tableList.Add(table);
                }
            }
            return(new questStatus(Severity.Success));
        }
Example #7
0
        public questStatus GetTableInfo(DatabaseId databaseId, TablesetTable tablesetTable, out Table table)
        {
            // Initialize
            questStatus status = null;

            table = null;


            // Get table
            DbTablesMgr dbTablesMgr = new DbTablesMgr(this._userSession);

            status = dbTablesMgr.Read(databaseId, tablesetTable.Schema, tablesetTable.Name, out table);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            tablesetTable.Table = table;


            // Get table columns
            TableId       tableId      = new TableId(table.Id);
            List <Column> columnList   = null;
            DbColumnsMgr  dbColumnsMgr = new DbColumnsMgr(this._userSession);

            status = dbColumnsMgr.Read(tableId, out columnList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            table.ColumnList = columnList;

            return(new questStatus(Severity.Success));
        }
Example #8
0
        public questStatus Read(DbMgrTransaction trans, DatabaseId databaseId, out List <Quest.Functional.MasterPricing.View> viewList)
        {
            // Initialize
            questStatus status = null;

            viewList = null;


            // Perform read
            List <Quest.Services.Dbio.MasterPricing.Views> _viewList = null;

            status = read((MasterPricingEntities)trans.DbContext, databaseId, out _viewList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            viewList = new List <View>();
            foreach (Quest.Services.Dbio.MasterPricing.Views _view in _viewList)
            {
                Quest.Functional.MasterPricing.View view = new View();
                BufferMgr.TransferBuffer(_view, view);
                viewList.Add(view);
            }
            return(new questStatus(Severity.Success));
        }
        public void It_should_be_different_than_new_instance_with_different_ids()
        {
            var secondInstance = new DatabaseId(new[] { 11L, 22L, 33L });

            Assert.That(secondInstance, Is.Not.EqualTo(SubjectUnderTest));
            Assert.That(secondInstance.GetHashCode(), Is.Not.EqualTo(SubjectUnderTest.GetHashCode()));
        }
Example #10
0
        private questStatus read(MasterPricingEntities dbContext, DatabaseId databaseId, string schema, string name, out Quest.Services.Dbio.MasterPricing.Tables table)
        {
            // Initialize
            questStatus status = null;

            table = null;


            try
            {
                table = dbContext.Tables.Where(r => r.DatabaseId == databaseId.Id && r.Schema == schema && r.Name == name).SingleOrDefault();
                if (table == null)
                {
                    return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}",
                                                                         this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                         String.Format("Schema {0} Name {1} not found", schema, name))));
                }
            }
            catch (System.Exception ex)
            {
                status = new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}",
                                                                       this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                       ex.InnerException != null ? ex.InnerException.Message : ex.Message));
                LogException(ex, status);
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
 internal StoreIntegrityCheckJob(DatabaseId databaseId, Guid requestGuid, JobFlags flags, MailboxCorruptionType[] taskIds) : this()
 {
     this.creationTime = new DateTime?(DateTime.UtcNow.ToLocalTime());
     this.flags        = flags;
     this.tasks        = taskIds;
     this.timeInServer = null;
 }
Example #12
0
        private questStatus read(MasterPricingEntities dbContext, DatabaseId databaseId, out List <Quest.Services.Dbio.MasterPricing.Tables> tablesList)
        {
            // Initialize
            questStatus status = null;

            tablesList = null;


            try
            {
                tablesList = dbContext.Tables.Where(r => r.DatabaseId == databaseId.Id).ToList();
                if (tablesList == null)
                {
                    return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}",
                                                                         this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                         String.Format("DatabaseId {0} not found", databaseId.Id))));
                }
            }
            catch (System.Exception ex)
            {
                status = new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}",
                                                                       this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                       ex.InnerException != null ? ex.InnerException.Message : ex.Message));
                LogException(ex, status);
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Example #13
0
        public questStatus Read(DatabaseId databaseId, out DatabaseEditorViewModel databaseEditorViewModel)
        {
            // Initialize
            questStatus status = null;

            databaseEditorViewModel = null;


            // Read
            Quest.Functional.MasterPricing.Database database = null;
            DatabasesMgr databasesMgr = new DatabasesMgr(this.UserSession);

            status = databasesMgr.Read(databaseId, out database);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Transfer model.
            databaseEditorViewModel = new DatabaseEditorViewModel(this.UserSession);
            BufferMgr.TransferBuffer(database, databaseEditorViewModel);



            return(new questStatus(Severity.Success));
        }
Example #14
0
        // Token: 0x06000454 RID: 1108 RVA: 0x0000F700 File Offset: 0x0000D900
        internal static DatabaseId ConvertDatabaseADObjectToDatabaseId(Database adObject)
        {
            if (adObject == null)
            {
                throw new ArgumentNullException("adObject");
            }
            string serverName = adObject.ServerName;
            string text       = adObject.Name;
            Guid   guid       = adObject.Guid;

            if (adObject.Identity != null)
            {
                DatabaseId databaseId = MapiTaskHelper.ConvertDatabaseADObjectIdToDatabaseId((ADObjectId)adObject.Identity);
                if (string.IsNullOrEmpty(serverName))
                {
                    serverName = databaseId.ServerName;
                }
                if (string.IsNullOrEmpty(text))
                {
                    text = databaseId.DatabaseName;
                }
                if (Guid.Empty == guid)
                {
                    guid = databaseId.Guid;
                }
            }
            return(new DatabaseId(null, serverName, text, guid));
        }
        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/

        #region Identifer-based Usage
        //
        // Identifer-based Usage
        //
        public questStatus Create(Quest.Functional.MasterPricing.Database database, out DatabaseId databaseId)
        {
            // Initialize
            questStatus status = null;

            databaseId = null;


            // Create the database
            DatabasesMgr databasesMgr = new DatabasesMgr(this.UserSession);

            status = databasesMgr.Create(database, out databaseId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Populate the database metadata
            status = RefreshSchema(databaseId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Example #16
0
        public questStatus Read(DbMgrTransaction trans, DatabaseId databaseId, out List <Quest.Functional.MasterPricing.Tableset> tablesetList)
        {
            // Initialize
            questStatus status = null;

            tablesetList = null;


            // Perform read
            List <Quest.Services.Dbio.MasterPricing.Tablesets> _tablesetList = null;

            status = read((MasterPricingEntities)trans.DbContext, databaseId, out _tablesetList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            tablesetList = new List <Quest.Functional.MasterPricing.Tableset>();
            foreach (Quest.Services.Dbio.MasterPricing.Tablesets _tableSet in _tablesetList)
            {
                Quest.Functional.MasterPricing.Tableset tableset = new Tableset();
                BufferMgr.TransferBuffer(_tableSet, tableset);
                tablesetList.Add(tableset);
            }
            return(new questStatus(Severity.Success));
        }
Example #17
0
        // TO DO:  The number of parameters here is obviously ridiculous... but is consistent with DDD
        //   principles
        public static Customer Create(int customerId, DateTime startDate, DateTime endDate, int statusCodeId, int nominationLevelId,
                                      AccountNumber accountNumber, int customerTypeId, int deliveryTypeId, DUNSNumber dunsNumber, LongName longName,
                                      ShortName shortName, DatabaseId ldcId, int lossTierId, DatabaseId deliveryLocation, int shipperId,
                                      DeliveryPressure deliveryPressure, MDQ mdq, MaxHourlyInterruptible maxHourlyInterruptible,
                                      MaxDailyInterruptible maxDailyInterruptible, HourlyInterruptible hourlyInterruptible,
                                      DailyInterruptible dailyInterruptible, TotalHourlySpecifiedFirm totalHourlySpecifiedFirm,
                                      TotalDailySpecifiedFirm totalDailySpecifiedFirm, InterstateSpecifiedFirm interstateSpecifiedFirm,
                                      IntrastateSpecifiedFirm intrastateSpecifiedFirm, CurrentDemand currentDemand, PreviousDemand previousDemand,
                                      int groupTypeId, int balancingLevelId, NAICSCode naicsCode, SICCode sicCode,
                                      SICCodePercentage sicCodePercentage, DateTime shippersLetterFromDate, DateTime shippersLetterToDate,
                                      bool ss1, bool isFederal, DateTime turnOffDate, DateTime turnOnDate)
        {
            DebugLog.Log("Entering Customer::Create");

            return(new Customer
            {
                Id = customerId,
                AccountNumber = accountNumber,
                AlternateCustomerId = null,
                BalancingLevelId = balancingLevelId,
                BasicPoolId = null,
                ContractTypeId = null,
                CurrentDemand = null,
                CustomerTypeId = customerTypeId,
                DailyInterruptible = dailyInterruptible,
                DeliveryLocation = deliveryLocation,
                DeliveryPressure = deliveryPressure,
                DeliveryTypeId = deliveryTypeId,
                DUNSNumber = dunsNumber,
                EndDate = endDate,
                GroupTypeId = groupTypeId,
                HourlyInterruptible = hourlyInterruptible,
                InterstateSpecifiedFirm = interstateSpecifiedFirm,
                IntrastateSpecifiedFirm = intrastateSpecifiedFirm,
                IsFederal = isFederal,
                LDCId = ldcId,
                LongName = longName,
                LossTierId = lossTierId,
                MaxDailyInterruptible = maxDailyInterruptible,
                MaxHourlyInterruptible = maxHourlyInterruptible,
                MDQ = mdq,
                NAICSCode = naicsCode,
                NominationLevelId = nominationLevelId,
                PreviousDemand = previousDemand,
                StartDate = startDate,
                StatusCodeId = statusCodeId,
                ShortName = shortName,
                ShipperId = shipperId,
                ShippersLetterFromDate = shippersLetterFromDate,
                ShippersLetterToDate = shippersLetterToDate,
                SICCode = sicCode,
                SICCodePercentage = sicCodePercentage,
                SS1 = ss1,
                TotalDailySpecifiedFirm = totalDailySpecifiedFirm,
                TotalHourlySpecifiedFirm = totalHourlySpecifiedFirm,
                TurnOffDate = turnOffDate,
                TurnOnDate = turnOnDate
            });
        }
Example #18
0
        private static async Task ProcessImageProcessingMessageAsync(ImageMessage message)
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            // keep track of the gallery id so we can work on the gallery after the message batch is processed
            lock (_galleryId)
                _galleryId = new DatabaseId(message.GalleryId, message.GalleryCategoryId);

            // retrieve Image object and bytes
            var image = await GetImageAsync(message.ImageId, message.GalleryId);

            var imageBytes = await GetImageBytesAsync(image);

            // create array of file specs to iterate over
            var specs = new List <FileSpec> {
                FileSpec.Spec3840, FileSpec.Spec2560, FileSpec.Spec1920, FileSpec.Spec800, FileSpec.SpecLowRes
            };

            // resize original image file to smaller versions in parallel
            //var parallelTasks = specs.Select(spec => ProcessImageAsync(image, imageBytes, spec)).ToList();
            //await Task.WhenAll(parallelTasks);

            //foreach (var spec in specs)
            //    await ProcessImageAsync(image, imageBytes, spec);

            // This approach is the fastest of the three methods here. I have no idea why.
            // 20MB image resized five times (each spec)
            // Task.WhenAll: 11785ms average
            // Foreach: 8540ms average
            // Parallel.Foreach with GetAwaiter/GetResult: 7887ms average
            Parallel.ForEach(specs, spec =>
            {
                ProcessImageAsync(image, imageBytes, spec).GetAwaiter().GetResult();
            });

            MetadataUtils.ParseAndAssignImageMetadata(image, imageBytes, message.OverwriteImageProperties, _log);
            await UpdateImageAsync(image);

            // pre-cache the image so it renders instantly for visitors
            PreCacheImage(image);

            // when uploading images, they don't have a position set, so if one is set when we process it here
            // then it's likely it's an existing Image that's having it's image file replaced. If so and the position
            // is zero then we want to make sure we update the gallery thumbnail to use the new image files.
            if (image.Position == 0)
            {
                _log.Debug("LB.PhotoGalleries.Worker.Program.ProcessImageProcessingMessageAsync() - Image position = 0, need to update gallery thumbnail...");
                var gallery = await GetGalleryAsync(image.GalleryCategoryId, image.GalleryId);
                await UpdateGalleryThumbnailAsync(gallery, image.Files);
            }

            stopwatch.Stop();
            _log.Information($"LB.PhotoGalleries.Worker.Program.ProcessImageProcessingMessageAsync() - Processed {image.Id} in {stopwatch.ElapsedMilliseconds}ms");
        }
Example #19
0
        public questStatus ReadTablesetConfiguration(TablesetId tablesetId, out TablesetConfiguration tablesetConfiguration)
        {
            // Initialize
            questStatus status = null;

            tablesetConfiguration = null;


            // Read tableset configuration
            status = _dbTablesetMgr.ReadTablesetConfiguration(tablesetId, out tablesetConfiguration);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Read database entities
            DatabaseId       databaseId       = new DatabaseId(tablesetConfiguration.Database.Id);
            DatabaseEntities databaseEntities = null;
            DatabaseMgr      databaseMgr      = new DatabaseMgr(this.UserSession);

            status = databaseMgr.ReadDatabaseEntities(databaseId, out databaseEntities);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }


            // Sort out what's assigned and not assigned to the tableset.
            List <Table> nonAssignedTableList = new List <Table>();
            List <View>  nonAssignedViewList  = new List <View>();

            foreach (Table table in databaseEntities.TableList)
            {
                TablesetTable tablesetTable = tablesetConfiguration.TablesetTables.Find(delegate(TablesetTable ts) { return(ts.Schema == table.Schema && ts.Name == table.Name); });
                if (tablesetTable == null)
                {
                    nonAssignedTableList.Add(table);
                }
            }
            tablesetConfiguration.DBTableList = nonAssignedTableList;

            // Load database views and columns into configuration NOT assigned to tableset.
            foreach (View view in databaseEntities.ViewList)
            {
                TablesetView tablesetView = tablesetConfiguration.TablesetViews.Find(delegate(TablesetView tv) { return(tv.Schema == view.Schema && tv.Name == view.Name); });
                if (tablesetView == null)
                {
                    nonAssignedViewList.Add(view);
                }
            }
            tablesetConfiguration.DBViewList = nonAssignedViewList;


            return(new questStatus(Severity.Success));
        }
Example #20
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Host != null ? Host.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AuthorisationKey != null ? AuthorisationKey.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DatabaseId != null ? DatabaseId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CollectionId != null ? CollectionId.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public questStatus PerformBulkInsert(BulkInsertRequest bulkInsertRequest)
        {
            // Initialize
            questStatus status = null;


            // Execute bulk insert SQL
            try
            {
                // Get tableset
                TablesetId     tablesetId     = new TablesetId(bulkInsertRequest.Filter.TablesetId);
                Tableset       tableset       = null;
                DbTablesetsMgr dbTablesetsMgr = new DbTablesetsMgr(this.UserSession);
                status = dbTablesetsMgr.Read(tablesetId, out tableset);
                if (!questStatusDef.IsSuccessOrWarning(status))
                {
                    return(status);
                }

                // Get database
                DatabaseId databaseId = new DatabaseId(tableset.DatabaseId);
                Quest.Functional.MasterPricing.Database database = null;
                DbDatabasesMgr dbDatabasesMgr = new DbDatabasesMgr(this.UserSession);
                status = dbDatabasesMgr.Read(databaseId, out database);
                if (!questStatusDef.IsSuccessOrWarning(status))
                {
                    return(status);
                }

                // Execute sql
                using (SqlConnection sqlConnection = new SqlConnection(database.ConnectionString))
                {
                    sqlConnection.Open();

                    using (SqlCommand cmd = sqlConnection.CreateCommand())
                    {
                        cmd.CommandText = bulkInsertRequest.SQL;
                        cmd.CommandType = CommandType.Text;

                        int numRows = cmd.ExecuteNonQuery();
                        if (numRows != bulkInsertRequest.Rows.Count)
                        {
                            return(new questStatus(Severity.Error, String.Format("ERROR: Bulk insert SQL execution failed: Rows: {0}", numRows)));
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                return(new questStatus(Severity.Fatal, String.Format("EXCEPTION: executing bulk insert SQL {0} SQL: {1}",
                                                                     bulkInsertRequest.SQL, ex.Message)));
            }
            return(new questStatus(Severity.Success));
        }
        private questStatus delete(MasterPricingEntities dbContext, DatabaseId databaseId)
        {
            // Initialize
            questStatus status = null;


            try
            {
                // Read all storedProcedures for this stored.
                List <Quest.Services.Dbio.MasterPricing.StoredProcedures> _storedProceduresList = null;
                status = read(dbContext, databaseId, out _storedProceduresList);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Delete their parameters.
                DbStoredProcedureParametersMgr dbStoredProcedureParametersMgr = new DbStoredProcedureParametersMgr(this.UserSession);
                foreach (Quest.Services.Dbio.MasterPricing.StoredProcedures _storedProcedure in _storedProceduresList)
                {
                    StoredProcedureId storedProcedureId = new StoredProcedureId(_storedProcedure.Id);
                    status = dbStoredProcedureParametersMgr.Delete(storedProcedureId);
                    if (!questStatusDef.IsSuccess(status))
                    {
                        return(status);
                    }
                }

                // Delete the records.
                dbContext.StoredProcedures.RemoveRange(_storedProceduresList);
                dbContext.SaveChanges();
            }
            catch (DbEntityValidationException ex)
            {
                var    errorMessages    = ex.EntityValidationErrors.SelectMany(x => x.ValidationErrors).Select(x => x.ErrorMessage);
                String fullErrorMessage = string.Join("; ", errorMessages);
                String exceptionMessage = string.Concat(ex.Message, fullErrorMessage);
                status = new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}",
                                                                       this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                       exceptionMessage));
                LogException(ex, status);
                return(status);
            }
            catch (System.Exception ex)
            {
                status = new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}",
                                                                       this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                       ex.InnerException != null ? ex.InnerException.Message : ex.Message));
                LogException(ex, status);
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
        public questStatus ReadDatabaseEntities(DatabaseId databaseId, out DatabaseEntities databaseEntities)
        {
            // Initialize
            questStatus status = null;

            status = _dbDatabaseMgr.ReadDatabaseEntities(databaseId, out databaseEntities);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
        public questStatus RefreshSchema(DatabaseId databaseId)
        {
            // Initialize
            questStatus status = null;

            status = _dbDatabaseMgr.RefreshSchema(databaseId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Example #25
0
        public questStatus Delete(DatabaseId databaseId)
        {
            // Initialize
            questStatus status = null;


            // Delete table
            status = _dbTablesMgr.Delete(databaseId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Example #26
0
        public questStatus Delete(DbMgrTransaction trans, DatabaseId databaseId)
        {
            // Initialize
            questStatus status = null;


            // Delete view
            status = _dbViewsMgr.Delete(trans, databaseId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
        public ActionResult Last(Quest.MasterPricing.Database.Models.TablesListViewModel tablesListViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                tablesListViewModel.questStatus = status;
                return(Json(tablesListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(tablesListViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                tablesListViewModel.questStatus = status;
                return(Json(tablesListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get list of items.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            DatabaseId databaseId = new DatabaseId(tablesListViewModel.DatabaseId);

            Quest.MasterPricing.Database.Models.TablesListViewModel tablesetsListViewModelNEW = null;
            TablesListModeler tablesListModeler = new TablesListModeler(this.Request, this.UserSession);

            status = tablesListModeler.List(databaseId, out tablesetsListViewModelNEW);
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                tablesListViewModel.questStatus = status;
                return(Json(tablesListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            tablesetsListViewModelNEW.DatabaseId  = tablesListViewModel.DatabaseId;
            tablesetsListViewModelNEW.questStatus = status;
            return(Json(tablesetsListViewModelNEW, JsonRequestBehavior.AllowGet));
        }
        public questStatus GetDatabaseMetainfo(DatabaseId databaseId, out DatabaseMetaInfo databaseMetaInfo)
        {
            // Initialize
            questStatus status = null;


            // Get database metainfo.
            status = _dbDatabaseMgr.GetDatabaseMetainfo(databaseId, out databaseMetaInfo);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
        public questStatus Delete(DbMgrTransaction trans, DatabaseId databaseId)
        {
            // Initialize
            questStatus status = null;


            // Delete all procedureProcedures in this procedure.
            status = _dbStoredProceduresMgr.Delete(trans, databaseId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Example #30
0
        public ActionResult PageNum(Quest.MasterPricing.Database.Models.StoredProceduresListViewModel storedProceduresListViewModel)
        {
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                storedProceduresListViewModel.questStatus = status;
                return(Json(storedProceduresListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(storedProceduresListViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                storedProceduresListViewModel.questStatus = status;
                return(Json(storedProceduresListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Get list of items.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            DatabaseId databaseId = new DatabaseId(storedProceduresListViewModel.DatabaseId);

            Quest.MasterPricing.Database.Models.StoredProceduresListViewModel viewsetsListViewModelNEW = null;
            StoredProceduresListModeler viewsListModeler = new StoredProceduresListModeler(this.Request, this.UserSession);

            status = viewsListModeler.List(databaseId, out viewsetsListViewModelNEW);
            if (!questStatusDef.IsSuccess(status))
            {
                status = new questStatus(Severity.Success);
                storedProceduresListViewModel.questStatus = status;
                return(Json(storedProceduresListViewModel, JsonRequestBehavior.AllowGet));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = new questStatus(Severity.Success);
            viewsetsListViewModelNEW.questStatus = status;
            return(Json(viewsetsListViewModelNEW, JsonRequestBehavior.AllowGet));
        }