Exemple #1
0
        private questStatus update(MasterPricingEntities dbContext, Quest.Functional.Logging.LogSetting logSetting)
        {
            // Initialize
            questStatus status = null;


            try
            {
                // Read the record.
                LogSettingId logSettingId = new LogSettingId(logSetting.Id);
                Quest.Services.Dbio.MasterPricing.LogSettings _logSetting = null;
                status = read(dbContext, out _logSetting);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Update the record.
                BufferMgr.TransferBuffer(logSetting, _logSetting);
                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 Read(DbMgrTransaction trans, out Quest.Functional.Logging.LogSetting logSetting)
        {
            // Initialize
            questStatus status = null;

            logSetting = null;


            // Perform read.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                Quest.Services.Dbio.MasterPricing.LogSettings _logSetting = null;
                status = read((MasterPricingEntities)trans.DbContext, out _logSetting);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                logSetting = new Quest.Functional.Logging.LogSetting();
                BufferMgr.TransferBuffer(_logSetting, logSetting);
            }
            return(new questStatus(Severity.Success));
        }
Exemple #3
0
        /*----------------------------------------------------------------------------------------------------------------------------------
        * LogSettings
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus read(MasterPricingEntities dbContext, out Quest.Services.Dbio.MasterPricing.LogSettings logSetting)
        {
            // Initialize
            logSetting = null;


            try
            {
                logSetting = dbContext.LogSettings.OrderByDescending(r => r.Id).FirstOrDefault();
                if (logSetting == null)
                {
                    return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}",
                                                                         this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                         String.Format("No record found"))));
                }
            }
            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));
        }