Exemplo n.º 1
0
        /*----------------------------------------------------------------------------------------------------------------------------------
        * BulkUpdateLogs
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog, out BulkUpdateLogId bulkUpdateLogId)
        {
            // Initialize
            bulkUpdateLogId = null;


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


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.BulkUpdateLogs _bulkUpdateLog = new Quest.Services.Dbio.MasterPricing.BulkUpdateLogs();
                BufferMgr.TransferBuffer(bulkUpdateLog, _bulkUpdateLog);
                dbContext.BulkUpdateLogs.Add(_bulkUpdateLog);
                dbContext.SaveChanges();
                if (_bulkUpdateLog.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.Logging.BulkUpdateLog not created"));
                }
                bulkUpdateLogId = new BulkUpdateLogId(_bulkUpdateLog.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));
        }
Exemplo n.º 2
0
        private questStatus update(MasterPricingEntities dbContext, Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog)
        {
            // Initialize
            questStatus status = null;


            try
            {
                // Read the record.
                BulkUpdateLogId bulkUpdateLogId = new BulkUpdateLogId(bulkUpdateLog.Id);
                Quest.Services.Dbio.MasterPricing.BulkUpdateLogs _bulkUpdateLog = null;
                status = read(dbContext, bulkUpdateLogId, out _bulkUpdateLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Update the record.
                BufferMgr.TransferBuffer(bulkUpdateLog, _bulkUpdateLog);
                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 Update(Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog)
        {
            // Initialize
            questStatus status = null;


            // Update bulkUpdateLog
            status = _dbBulkUpdateLogsMgr.Update(bulkUpdateLog);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemplo n.º 4
0
        public questStatus List(QueryOptions queryOptions, out List <Quest.Functional.Logging.BulkUpdateLog> bulkUpdateLogList, out QueryResponse queryResponse)
        {
            // Initialize
            questStatus status = null;

            bulkUpdateLogList = null;
            queryResponse     = null;


            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                using (DbContextTransaction tx = dbContext.Database.BeginTransaction(IsolationLevel.ReadUncommitted))
                {
                    try
                    {
                        PropertyInfo[] dbProperties = typeof(Quest.Services.Dbio.MasterPricing.BulkUpdateLogs).GetProperties().ToArray();
                        int            totalRecords = dbContext.BulkUpdateLogs.Where(BuildWhereClause(queryOptions, dbProperties)).Count();
                        List <Quest.Services.Dbio.MasterPricing.BulkUpdateLogs> _bulkUpdateLogsList = dbContext.BulkUpdateLogs.Where(BuildWhereClause(queryOptions, dbProperties))
                                                                                                      .OrderBy(BuildSortString(queryOptions.SortColumns))
                                                                                                      .Skip(queryOptions.Paging.PageSize * (queryOptions.Paging.PageNumber - 1))
                                                                                                      .Take(queryOptions.Paging.PageSize).ToList();
                        if (_bulkUpdateLogsList == null)
                        {
                            return(new questStatus(Severity.Warning));
                        }
                        bulkUpdateLogList = new List <Quest.Functional.Logging.BulkUpdateLog>();
                        foreach (Quest.Services.Dbio.MasterPricing.BulkUpdateLogs _bulkUpdateLog in _bulkUpdateLogsList)
                        {
                            Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog = new Quest.Functional.Logging.BulkUpdateLog();
                            BufferMgr.TransferBuffer(_bulkUpdateLog, bulkUpdateLog);
                            bulkUpdateLogList.Add(bulkUpdateLog);
                        }
                        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));
        }
Exemplo n.º 5
0
        public questStatus Update(DbMgrTransaction trans, Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog)
        {
            // Initialize
            questStatus status             = null;
            bool        bCreateTransaction = trans == null;


            // Perform update in this transaction.
            status = update((MasterPricingEntities)trans.DbContext, bulkUpdateLog);
            if (!questStatusDef.IsSuccess(status))
            {
                RollbackTransaction(trans);
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemplo n.º 6
0
        public questStatus Update(Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog)
        {
            // Initialize
            questStatus status = null;


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


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog, out Quest.Functional.Logging.BulkUpdateLogId bulkUpdateLogId)
        {
            // Initialize
            bulkUpdateLogId = null;
            questStatus status = null;

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


            // Create bulkUpdateLog
            status = _dbBulkUpdateLogsMgr.Create(bulkUpdateLog, out bulkUpdateLogId);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }
Exemplo n.º 8
0
        public questStatus Create(DbMgrTransaction trans, Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog, out Quest.Functional.Logging.BulkUpdateLogId bulkUpdateLogId)
        {
            // Initialize
            questStatus status = null;

            bulkUpdateLogId = null;


            // Data rules.


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


        #region Public Methods

        /*==================================================================================================================================
        * Public Methods
        *=================================================================================================================================*/
        public questStatus Create(Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog, out Quest.Functional.Logging.BulkUpdateLogId bulkUpdateLogId)
        {
            // Initialize
            questStatus status = null;

            bulkUpdateLogId = null;


            // Data rules.


            // Create the bulkUpdateLog
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                status = create(dbContext, bulkUpdateLog, out bulkUpdateLogId);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
            }
            return(new questStatus(Severity.Success));
        }
Exemplo n.º 10
0
        public questStatus Read(DbMgrTransaction trans, Quest.Functional.Logging.BulkUpdateLogId bulkUpdateLogId, out Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog)
        {
            // Initialize
            questStatus status = null;

            bulkUpdateLog = null;


            // Perform read.
            using (MasterPricingEntities dbContext = new MasterPricingEntities())
            {
                Quest.Services.Dbio.MasterPricing.BulkUpdateLogs _bulkUpdateLog = null;
                status = read((MasterPricingEntities)trans.DbContext, bulkUpdateLogId, out _bulkUpdateLog);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }
                bulkUpdateLog = new Quest.Functional.Logging.BulkUpdateLog();
                BufferMgr.TransferBuffer(_bulkUpdateLog, bulkUpdateLog);
            }
            return(new questStatus(Severity.Success));
        }
        public questStatus Read(Quest.Functional.Logging.BulkUpdateLogId bulkUpdateLogId, out Quest.Functional.Logging.BulkUpdateLog bulkUpdateLog)
        {
            // Initialize
            bulkUpdateLog = null;
            questStatus status = null;


            // Read bulkUpdateLog
            status = _dbBulkUpdateLogsMgr.Read(bulkUpdateLogId, out bulkUpdateLog);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            return(new questStatus(Severity.Success));
        }