Ejemplo n.º 1
0
        private questStatus delete(MasterPricingEntities dbContext, Quest.Functional.Logging.ExceptionLogId exceptionLogId)
        {
            // Initialize
            questStatus status = null;


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

                // Delete the record.
                dbContext.ExceptionLogs.Remove(_exceptionLog);
                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));
        }
        public questStatus Delete(Quest.Functional.Logging.ExceptionLogId exceptionLogId)
        {
            // Initialize
            questStatus status = null;


            // Delete exceptionLog
            status = _dbExceptionLogsMgr.Delete(exceptionLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
        public questStatus Read(Quest.Functional.Logging.ExceptionLogId exceptionLogId, out Quest.Functional.Logging.ExceptionLog exceptionLog)
        {
            // Initialize
            exceptionLog = null;
            questStatus status = null;


            // Read exceptionLog
            status = _dbExceptionLogsMgr.Read(exceptionLogId, out exceptionLog);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 4
0
        public questStatus Delete(DbMgrTransaction trans, Quest.Functional.Logging.ExceptionLogId exceptionLogId)
        {
            // Initialize
            questStatus status = null;


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


            // Perform delete.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                status = delete(dbContext, exceptionLogId);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 6
0
        public questStatus Read(DbMgrTransaction trans, Quest.Functional.Logging.ExceptionLogId exceptionLogId, out Quest.Functional.Logging.ExceptionLog exceptionLog)
        {
            // Initialize
            questStatus status = null;

            exceptionLog = null;


            // Perform read.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                Quest.Services.Dbio.MasterPricing.ExceptionLogs _exceptionLog = null;
                status = read((MasterPricingEntities)trans.DbContext, exceptionLogId, out _exceptionLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                exceptionLog = new Quest.Functional.Logging.ExceptionLog();
                BufferMgr.TransferBuffer(_exceptionLog, exceptionLog);
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 7
0
        private questStatus read(MasterPricingEntities dbContext, Quest.Functional.Logging.ExceptionLogId exceptionLogId, out Quest.Services.Dbio.MasterPricing.ExceptionLogs exceptionLog)
        {
            // Initialize
            exceptionLog = null;


            try
            {
                exceptionLog = dbContext.ExceptionLogs.Where(r => r.Id == exceptionLogId.Id).SingleOrDefault();
                if (exceptionLog == null)
                {
                    return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}",
                                                                         this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                         String.Format("Id {0} not found", exceptionLogId.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));
        }
        /*==================================================================================================================================
        * Properties
        *=================================================================================================================================*/
        #endregion


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.ExceptionLog exceptionLog, out Quest.Functional.Logging.ExceptionLogId exceptionLogId)
        {
            // Initialize
            exceptionLogId = null;
            questStatus status = null;

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


            // Create exceptionLog
            status = _dbExceptionLogsMgr.Create(exceptionLog, out exceptionLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 9
0
        public questStatus Create(DbMgrTransaction trans, Quest.Functional.Logging.ExceptionLog exceptionLog, out Quest.Functional.Logging.ExceptionLogId exceptionLogId)
        {
            // Initialize
            questStatus status = null;

            exceptionLogId = null;


            // Data rules.


            // Create the exceptionLog in this transaction.
            status = create((MasterPricingEntities)trans.DbContext, exceptionLog, out exceptionLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 10
0
        /*==================================================================================================================================
        * Properties
        *=================================================================================================================================*/
        #endregion


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.ExceptionLog exceptionLog, out Quest.Functional.Logging.ExceptionLogId exceptionLogId)
        {
            // Initialize
            questStatus status = null;

            exceptionLogId = null;


            // Data rules.


            // Create the exceptionLog
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                status = create(dbContext, exceptionLog, out exceptionLogId);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }