Ejemplo n.º 1
0
        public questStatus StackTrace(ExceptionsEditorViewModel exceptionsEditorViewModel, out ExceptionsEditorViewModel exceptionsEditorViewModelNEW)
        {
            // Initialize
            questStatus status = null;

            exceptionsEditorViewModelNEW = null;


            // Get the exception
            ExceptionLogId   exceptionLogId   = new ExceptionLogId(exceptionsEditorViewModel.Id);
            ExceptionLog     exceptionLog     = null;
            ExceptionLogsMgr exceptionLogsMgr = new ExceptionLogsMgr(this.UserSession);

            status = exceptionLogsMgr.Read(exceptionLogId, out exceptionLog);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }

            // Transfer model.
            exceptionsEditorViewModelNEW = new ExceptionsEditorViewModel(this.UserSession, exceptionsEditorViewModel);
            BufferMgr.TransferBuffer(exceptionLog, exceptionsEditorViewModelNEW);

            // Format the stack trace.
            string _stackTrace = exceptionsEditorViewModelNEW.StackTrace.Replace(System.Environment.NewLine, "<br/>");

            exceptionsEditorViewModelNEW.StackTrace = _stackTrace;

            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 2
0
        public questStatus Delete(DeleteLogItemsViewModel deleteLogItemsViewModel)
        {
            // Initialize
            questStatus status = null;


            // Build id list
            List <ExceptionLogId> exceptionLogIdList = new List <ExceptionLogId>();

            foreach (BaseId baseId in deleteLogItemsViewModel.Items)
            {
                ExceptionLogId exceptionLogId = new ExceptionLogId(baseId.Id);
                exceptionLogIdList.Add(exceptionLogId);
            }

            // Delete items
            ExceptionLogsMgr exceptionLogsMgr = new ExceptionLogsMgr(this.UserSession);

            status = exceptionLogsMgr.Delete(exceptionLogIdList);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 3
0
        private questStatus update(MasterPricingEntities dbContext, Quest.Functional.Logging.ExceptionLog exceptionLog)
        {
            // Initialize
            questStatus status = null;


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

                // Update the record.
                BufferMgr.TransferBuffer(exceptionLog, _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));
        }
Ejemplo n.º 4
0
        /*----------------------------------------------------------------------------------------------------------------------------------
        * ExceptionLogs
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.Logging.ExceptionLog exceptionLog, out ExceptionLogId exceptionLogId)
        {
            // Initialize
            exceptionLogId = null;


            // Initialize
            exceptionLog.UserSessionId = this.UserSession.Id;
            exceptionLog.Username      = this.UserSession.User.Username;
            exceptionLog.Created       = DateTime.Now;


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.ExceptionLogs _exceptionLog = new Quest.Services.Dbio.MasterPricing.ExceptionLogs();
                BufferMgr.TransferBuffer(exceptionLog, _exceptionLog);
                dbContext.ExceptionLogs.Add(_exceptionLog);
                dbContext.SaveChanges();
                if (_exceptionLog.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.Logging.ExceptionLog not created"));
                }
                exceptionLogId = new ExceptionLogId(_exceptionLog.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));
        }
Ejemplo n.º 5
0
        public questStatus LogException(ExceptionLog exceptionLog)
        {
            // Initialize
            questStatus status = null;


            // If NOT logging, return.
            if (!this.LogSettings.bLogExceptions)
            {
                return(new questStatus(Severity.Success));
            }

            // Create exception log entry
            ExceptionLogId exceptionLogId = null;

            status = _dbExceptionLogsMgr.Create(exceptionLog, out exceptionLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Returns the typed string of the primary property.
 /// </summary>
 public override string ToString()
 {
     return(ExceptionLogId.ToString());
 }