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


            try
            {
                // Read the record.
                FilterProcedureId filterProcedureId = new FilterProcedureId(filterProcedure.Id);
                Quest.Services.Dbio.MasterPricing.FilterProcedures _filterProcedures = null;
                status = read(dbContext, filterProcedureId, out _filterProcedures);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Update the record.
                BufferMgr.TransferBuffer(filterProcedure, _filterProcedures);
                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));
        }
        /*----------------------------------------------------------------------------------------------------------------------------------
        * FilterProcedures
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.MasterPricing.FilterProcedure filterProcedure, out FilterProcedureId filterProcedureId)
        {
            // Initialize
            filterProcedureId = null;


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.FilterProcedures _filterProcedures = new Quest.Services.Dbio.MasterPricing.FilterProcedures();
                BufferMgr.TransferBuffer(filterProcedure, _filterProcedures);
                dbContext.FilterProcedures.Add(_filterProcedures);
                dbContext.SaveChanges();
                if (_filterProcedures.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.MasterPricing.FilterProcedure not created"));
                }
                filterProcedureId = new FilterProcedureId(_filterProcedures.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.FilterProcedure> filterProcedureList, out List <Quest.Functional.MasterPricing.FilterProcedure> filterProcedureIdList)
        {
            // Initialize
            filterProcedureIdList = null;


            // Perform create
            try
            {
                List <Quest.Services.Dbio.MasterPricing.FilterProcedures> _filterProcedureList = new List <Quest.Services.Dbio.MasterPricing.FilterProcedures>();
                foreach (Quest.Functional.MasterPricing.FilterProcedure filterProcedure in filterProcedureList)
                {
                    Quest.Services.Dbio.MasterPricing.FilterProcedures _filterProcedure = new Quest.Services.Dbio.MasterPricing.FilterProcedures();
                    BufferMgr.TransferBuffer(filterProcedure, _filterProcedure);
                    _filterProcedureList.Add(_filterProcedure);
                }
                dbContext.FilterProcedures.AddRange(_filterProcedureList);
                dbContext.SaveChanges();

                filterProcedureIdList = new List <FilterProcedure>();
                foreach (Quest.Services.Dbio.MasterPricing.FilterProcedures _filterProcedure in _filterProcedureList)
                {
                    Quest.Functional.MasterPricing.FilterProcedure filterProcedure = new FilterProcedure();
                    filterProcedure.Id = _filterProcedure.Id;
                    filterProcedureIdList.Add(filterProcedure);
                }
            }
            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, FilterProcedureId filterProcedureId, out Quest.Functional.MasterPricing.FilterProcedure filterProcedure)
        {
            // Initialize
            questStatus status = null;

            filterProcedure = null;


            // Perform read
            Quest.Services.Dbio.MasterPricing.FilterProcedures _filterProcedures = null;
            status = read((MasterPricingEntities)trans.DbContext, filterProcedureId, out _filterProcedures);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            filterProcedure = new Quest.Functional.MasterPricing.FilterProcedure();
            BufferMgr.TransferBuffer(_filterProcedures, filterProcedure);

            return(new questStatus(Severity.Success));
        }
        private questStatus read(MasterPricingEntities dbContext, FilterProcedureId filterProcedureId, out Quest.Services.Dbio.MasterPricing.FilterProcedures filterProcedure)
        {
            // Initialize
            filterProcedure = null;


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