Пример #1
0
        private questStatus delete(MasterPricingEntities dbContext, Quest.Functional.Logging.HTTPRequestLogId httpRequestLogId)
        {
            // Initialize
            questStatus status = null;


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

                // Delete the record.
                dbContext.HTTPRequestLogs.Remove(_httpRequestLog);
                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));
        }
Пример #2
0
        /*----------------------------------------------------------------------------------------------------------------------------------
        * HTTPRequestLogs
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.Logging.HTTPRequestLog httpRequestLog, out HTTPRequestLogId httpRequestLogId)
        {
            // Initialize
            httpRequestLogId = null;


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.HTTPRequestLogs _httpRequestLog = new Quest.Services.Dbio.MasterPricing.HTTPRequestLogs();
                BufferMgr.TransferBuffer(httpRequestLog, _httpRequestLog);
                dbContext.HTTPRequestLogs.Add(_httpRequestLog);
                dbContext.SaveChanges();
                if (_httpRequestLog.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.Logging.HTTPRequestLog not created"));
                }
                httpRequestLogId = new HTTPRequestLogId(_httpRequestLog.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));
        }
Пример #3
0
        public questStatus Read(DbMgrTransaction trans, Quest.Functional.Logging.HTTPRequestLogId httpRequestLogId, out Quest.Functional.Logging.HTTPRequestLog httpRequestLog)
        {
            // Initialize
            questStatus status = null;

            httpRequestLog = null;


            // Perform read.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                Quest.Services.Dbio.MasterPricing.HTTPRequestLogs _httpRequestLog = null;
                status = read((MasterPricingEntities)trans.DbContext, httpRequestLogId, out _httpRequestLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                httpRequestLog = new Quest.Functional.Logging.HTTPRequestLog();
                BufferMgr.TransferBuffer(_httpRequestLog, httpRequestLog);
            }
            return(new questStatus(Severity.Success));
        }
Пример #4
0
        private questStatus read(MasterPricingEntities dbContext, string username, out Quest.Services.Dbio.MasterPricing.HTTPRequestLogs httpRequestLog)
        {
            // Initialize
            httpRequestLog = null;


            try
            {
                httpRequestLog = dbContext.HTTPRequestLogs.Where(r => r.Username == username).SingleOrDefault();
                if (httpRequestLog == null)
                {
                    return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}",
                                                                         this.GetType().Name, MethodBase.GetCurrentMethod().Name,
                                                                         String.Format("Username {0} not found", username))));
                }
            }
            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));
        }