Exemple #1
0
        private questStatus delete(MasterPricingEntities dbContext, Quest.Functional.Logging.DatabaseLogId databaseLogId)
        {
            // Initialize
            questStatus status = null;


            try
            {
                // Read the record.
                Quest.Services.Dbio.MasterPricing.DatabaseLogs _databaseLog = null;
                status = read(dbContext, databaseLogId, out _databaseLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Delete the record.
                dbContext.DatabaseLogs.Remove(_databaseLog);
                dbContext.SaveChanges();
            }
            catch (System.Exception ex)
            {
                return(new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}",
                                                                     this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                     ex.InnerException != null ? ex.InnerException.Message : ex.Message)));
            }
            return(new questStatus(Severity.Success));
        }
Exemple #2
0
        public questStatus Delete(Quest.Functional.Logging.DatabaseLogId databaseLogId)
        {
            // Initialize
            questStatus status = null;


            // Delete databaseLog
            status = _dbDatabaseLogsMgr.Delete(databaseLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemple #3
0
        public questStatus Read(Quest.Functional.Logging.DatabaseLogId databaseLogId, out Quest.Functional.Logging.DatabaseLog databaseLog)
        {
            // Initialize
            databaseLog = null;
            questStatus status = null;


            // Read databaseLog
            status = _dbDatabaseLogsMgr.Read(databaseLogId, out databaseLog);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemple #4
0
        public questStatus Delete(DbMgrTransaction trans, Quest.Functional.Logging.DatabaseLogId databaseLogId)
        {
            // Initialize
            questStatus status = null;


            // Perform delete in this transaction.
            status = delete((MasterPricingEntities)trans.DbContext, databaseLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                RollbackTransaction(trans);
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemple #5
0
        public questStatus Delete(Quest.Functional.Logging.DatabaseLogId databaseLogId)
        {
            // Initialize
            questStatus status = null;


            // Perform delete.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                status = delete(dbContext, databaseLogId);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }
Exemple #6
0
        /*==================================================================================================================================
        * Properties
        *=================================================================================================================================*/
        #endregion


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.DatabaseLog databaseLog, out Quest.Functional.Logging.DatabaseLogId databaseLogId)
        {
            // Initialize
            databaseLogId = null;
            questStatus status = null;

            // Date/time stamp it
            databaseLog.Created = DateTime.Now;


            // Create databaseLog
            status = _dbDatabaseLogsMgr.Create(databaseLog, out databaseLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemple #7
0
        /*==================================================================================================================================
        * Properties
        *=================================================================================================================================*/
        #endregion


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.DatabaseLog databaseLog, out Quest.Functional.Logging.DatabaseLogId databaseLogId)
        {
            // Initialize
            questStatus status = null;

            databaseLogId = null;


            // Data rules.


            // Create the databaseLog
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                status = create(dbContext, databaseLog, out databaseLogId);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }
Exemple #8
0
        public questStatus Read(DbMgrTransaction trans, Quest.Functional.Logging.DatabaseLogId databaseLogId, out Quest.Functional.Logging.DatabaseLog databaseLog)
        {
            // Initialize
            questStatus status = null;

            databaseLog = null;


            // Perform read.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                Quest.Services.Dbio.MasterPricing.DatabaseLogs _databaseLog = null;
                status = read((MasterPricingEntities)trans.DbContext, databaseLogId, out _databaseLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                databaseLog = new Quest.Functional.Logging.DatabaseLog();
                BufferMgr.TransferBuffer(_databaseLog, databaseLog);
            }
            return(new questStatus(Severity.Success));
        }
Exemple #9
0
        private questStatus read(MasterPricingEntities dbContext, Quest.Functional.Logging.DatabaseLogId databaseLogId, out Quest.Services.Dbio.MasterPricing.DatabaseLogs databaseLog)
        {
            // Initialize
            databaseLog = null;


            try
            {
                databaseLog = dbContext.DatabaseLogs.Where(r => r.Id == databaseLogId.Id).SingleOrDefault();
                if (databaseLog == null)
                {
                    return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}",
                                                                         this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                         String.Format("Id {0} not found", databaseLogId.Id))));
                }
            }
            catch (System.Exception ex)
            {
                return(new questStatus(Severity.Fatal, String.Format("EXCEPTION: {0}.{1}: {2}",
                                                                     this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                     ex.InnerException != null ? ex.InnerException.Message : ex.Message)));
            }
            return(new questStatus(Severity.Success));
        }
Exemple #10
0
        public questStatus Create(DbMgrTransaction trans, Quest.Functional.Logging.DatabaseLog databaseLog, out Quest.Functional.Logging.DatabaseLogId databaseLogId)
        {
            // Initialize
            questStatus status = null;

            databaseLogId = null;


            // Data rules.


            // Create the databaseLog in this transaction.
            status = create((MasterPricingEntities)trans.DbContext, databaseLog, out databaseLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }