private questStatus update(MasterPricingEntities dbContext, Quest.Functional.MasterPricing.FilterColumn filterColumn)
        {
            // Initialize
            questStatus status = null;


            try
            {
                // Read the record.
                FilterColumnId filterColumnId = new FilterColumnId(filterColumn.Id);
                Quest.Services.Dbio.MasterPricing.FilterColumns _filterColumns = null;
                status = read(dbContext, filterColumnId, out _filterColumns);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Update the record.
                BufferMgr.TransferBuffer(filterColumn, _filterColumns);
                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));
        }
        /*----------------------------------------------------------------------------------------------------------------------------------
        * FilterColumns
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.MasterPricing.FilterColumn filterColumn, out FilterColumnId filterColumnId)
        {
            // Initialize
            filterColumnId = null;


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.FilterColumns _filterColumns = new Quest.Services.Dbio.MasterPricing.FilterColumns();
                BufferMgr.TransferBuffer(filterColumn, _filterColumns);
                dbContext.FilterColumns.Add(_filterColumns);
                dbContext.SaveChanges();
                if (_filterColumns.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.MasterPricing.FilterColumn not created"));
                }
                filterColumnId = new FilterColumnId(_filterColumns.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));
        }
        private questStatus create(MasterPricingEntities dbContext, List <Quest.Functional.MasterPricing.FilterColumn> filterColumnList, out List <Quest.Functional.MasterPricing.FilterColumn> filterColumnIdList)
        {
            // Initialize
            filterColumnIdList = null;


            // Perform create
            try
            {
                List <Quest.Services.Dbio.MasterPricing.FilterColumns> _filterColumnList = new List <Quest.Services.Dbio.MasterPricing.FilterColumns>();
                foreach (Quest.Functional.MasterPricing.FilterColumn filterColumn in filterColumnList)
                {
                    Quest.Services.Dbio.MasterPricing.FilterColumns _filterColumn = new Quest.Services.Dbio.MasterPricing.FilterColumns();
                    BufferMgr.TransferBuffer(filterColumn, _filterColumn);
                    _filterColumnList.Add(_filterColumn);
                }
                dbContext.FilterColumns.AddRange(_filterColumnList);
                dbContext.SaveChanges();

                filterColumnIdList = new List <FilterColumn>();
                foreach (Quest.Services.Dbio.MasterPricing.FilterColumns _filterColumn in _filterColumnList)
                {
                    Quest.Functional.MasterPricing.FilterColumn filterColumn = new FilterColumn();
                    filterColumn.Id = _filterColumn.Id;
                    filterColumnIdList.Add(filterColumn);
                }
            }
            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 Read(DbMgrTransaction trans, FilterColumnId filterColumnId, out Quest.Functional.MasterPricing.FilterColumn filterColumn)
        {
            // Initialize
            questStatus status = null;

            filterColumn = null;


            // Perform read
            Quest.Services.Dbio.MasterPricing.FilterColumns _filterColumns = null;
            status = read((MasterPricingEntities)trans.DbContext, filterColumnId, out _filterColumns);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            filterColumn = new Quest.Functional.MasterPricing.FilterColumn();
            BufferMgr.TransferBuffer(_filterColumns, filterColumn);

            return(new questStatus(Severity.Success));
        }
        private questStatus read(MasterPricingEntities dbContext, FilterColumnId filterColumnId, out Quest.Services.Dbio.MasterPricing.FilterColumns filterColumn)
        {
            // Initialize
            filterColumn = null;


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