예제 #1
0
        /*----------------------------------------------------------------------------------------------------------------------------------
        * BulkInsertLogs
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.Logging.BulkInsertLog bulkInsertLog, out BulkInsertLogId bulkInsertLogId)
        {
            // Initialize
            bulkInsertLogId = null;


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


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.BulkInsertLogs _bulkInsertLog = new Quest.Services.Dbio.MasterPricing.BulkInsertLogs();
                BufferMgr.TransferBuffer(bulkInsertLog, _bulkInsertLog);
                dbContext.BulkInsertLogs.Add(_bulkInsertLog);
                dbContext.SaveChanges();
                if (_bulkInsertLog.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.Logging.BulkInsertLog not created"));
                }
                bulkInsertLogId = new BulkInsertLogId(_bulkInsertLog.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));
        }
예제 #2
0
        private questStatus update(MasterPricingEntities dbContext, Quest.Functional.Logging.BulkInsertLog bulkInsertLog)
        {
            // Initialize
            questStatus status = null;


            try
            {
                // Read the record.
                BulkInsertLogId bulkInsertLogId = new BulkInsertLogId(bulkInsertLog.Id);
                Quest.Services.Dbio.MasterPricing.BulkInsertLogs _bulkInsertLog = null;
                status = read(dbContext, bulkInsertLogId, out _bulkInsertLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Update the record.
                BufferMgr.TransferBuffer(bulkInsertLog, _bulkInsertLog);
                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));
        }
예제 #3
0
        public questStatus Update(Quest.Functional.Logging.BulkInsertLog bulkInsertLog)
        {
            // Initialize
            questStatus status = null;


            // Update bulkInsertLog
            status = _dbBulkInsertLogsMgr.Update(bulkInsertLog);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
예제 #4
0
        public questStatus List(QueryOptions queryOptions, out List <Quest.Functional.Logging.BulkInsertLog> bulkInsertLogList, out QueryResponse queryResponse)
        {
            // Initialize
            questStatus status = null;

            bulkInsertLogList = null;
            queryResponse     = null;


            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                using (DbContextTransaction tx = dbContext.Database.BeginTransaction(IsolationLevel.ReadUncommitted))
                {
                    try
                    {
                        PropertyInfo[] dbProperties = typeof(Quest.Services.Dbio.MasterPricing.BulkInsertLogs).GetProperties().ToArray();
                        int            totalRecords = dbContext.BulkInsertLogs.Where(BuildWhereClause(queryOptions, dbProperties)).Count();
                        List <Quest.Services.Dbio.MasterPricing.BulkInsertLogs> _bulkInsertLogsList = dbContext.BulkInsertLogs.Where(BuildWhereClause(queryOptions, dbProperties))
                                                                                                      .OrderBy(BuildSortString(queryOptions.SortColumns))
                                                                                                      .Skip(queryOptions.Paging.PageSize * (queryOptions.Paging.PageNumber - 1))
                                                                                                      .Take(queryOptions.Paging.PageSize).ToList();
                        if (_bulkInsertLogsList == null)
                        {
                            return(new questStatus(Severity.Warning));
                        }
                        bulkInsertLogList = new List <Quest.Functional.Logging.BulkInsertLog>();
                        foreach (Quest.Services.Dbio.MasterPricing.BulkInsertLogs _bulkInsertLog in _bulkInsertLogsList)
                        {
                            Quest.Functional.Logging.BulkInsertLog bulkInsertLog = new Quest.Functional.Logging.BulkInsertLog();
                            BufferMgr.TransferBuffer(_bulkInsertLog, bulkInsertLog);
                            bulkInsertLogList.Add(bulkInsertLog);
                        }
                        status = BuildQueryResponse(totalRecords, queryOptions, out queryResponse);
                        if (!questStatusDef.IsSuccess(status))
                        {
                            return(status);
                        }
                    }
                    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));
        }
예제 #5
0
        public questStatus Update(DbMgrTransaction trans, Quest.Functional.Logging.BulkInsertLog bulkInsertLog)
        {
            // Initialize
            questStatus status             = null;
            bool        bCreateTransaction = trans == null;


            // Perform update in this transaction.
            status = update((MasterPricingEntities)trans.DbContext, bulkInsertLog);
            if (!questStatusDef.IsSuccess(status))
            {
                RollbackTransaction(trans);
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
예제 #6
0
        public questStatus Update(Quest.Functional.Logging.BulkInsertLog bulkInsertLog)
        {
            // Initialize
            questStatus status = null;


            // Perform update.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                status = update(dbContext, bulkInsertLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }
예제 #7
0
        /*==================================================================================================================================
        * Properties
        *=================================================================================================================================*/
        #endregion


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.BulkInsertLog bulkInsertLog, out Quest.Functional.Logging.BulkInsertLogId bulkInsertLogId)
        {
            // Initialize
            bulkInsertLogId = null;
            questStatus status = null;

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


            // Create bulkInsertLog
            status = _dbBulkInsertLogsMgr.Create(bulkInsertLog, out bulkInsertLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
예제 #8
0
        public questStatus Create(DbMgrTransaction trans, Quest.Functional.Logging.BulkInsertLog bulkInsertLog, out Quest.Functional.Logging.BulkInsertLogId bulkInsertLogId)
        {
            // Initialize
            questStatus status = null;

            bulkInsertLogId = null;


            // Data rules.


            // Create the bulkInsertLog in this transaction.
            status = create((MasterPricingEntities)trans.DbContext, bulkInsertLog, out bulkInsertLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
예제 #9
0
        public questStatus Read(DbMgrTransaction trans, Quest.Functional.Logging.BulkInsertLogId bulkInsertLogId, out Quest.Functional.Logging.BulkInsertLog bulkInsertLog)
        {
            // Initialize
            questStatus status = null;

            bulkInsertLog = null;


            // Perform read.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                Quest.Services.Dbio.MasterPricing.BulkInsertLogs _bulkInsertLog = null;
                status = read((MasterPricingEntities)trans.DbContext, bulkInsertLogId, out _bulkInsertLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                bulkInsertLog = new Quest.Functional.Logging.BulkInsertLog();
                BufferMgr.TransferBuffer(_bulkInsertLog, bulkInsertLog);
            }
            return(new questStatus(Severity.Success));
        }
예제 #10
0
        /*==================================================================================================================================
        * Properties
        *=================================================================================================================================*/
        #endregion


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.BulkInsertLog bulkInsertLog, out Quest.Functional.Logging.BulkInsertLogId bulkInsertLogId)
        {
            // Initialize
            questStatus status = null;

            bulkInsertLogId = null;


            // Data rules.
            bulkInsertLog.Created = DateTime.Now;


            // Create the bulkInsertLog
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                status = create(dbContext, bulkInsertLog, out bulkInsertLogId);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }
예제 #11
0
        public questStatus Read(Quest.Functional.Logging.BulkInsertLogId bulkInsertLogId, out Quest.Functional.Logging.BulkInsertLog bulkInsertLog)
        {
            // Initialize
            bulkInsertLog = null;
            questStatus status = null;


            // Read bulkInsertLog
            status = _dbBulkInsertLogsMgr.Read(bulkInsertLogId, out bulkInsertLog);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }