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


            try
            {
                // Read the record.
                FilterProcedureParameterId filterProcedureParameterId = new FilterProcedureParameterId(filterProcedureParameter.Id);
                Quest.Services.Dbio.MasterPricing.FilterProcedureParameters _filterProcedureParameters = null;
                status = read(dbContext, filterProcedureParameterId, out _filterProcedureParameters);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Update the record.
                BufferMgr.TransferBuffer(filterProcedureParameter, _filterProcedureParameters);
                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));
        }
        /*----------------------------------------------------------------------------------------------------------------------------------
        * FilterProcedureParameters
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.MasterPricing.FilterProcedureParameter filterProcedureParameter, out FilterProcedureParameterId filterProcedureParameterId)
        {
            // Initialize
            filterProcedureParameterId = null;


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.FilterProcedureParameters _filterProcedureParameters = new Quest.Services.Dbio.MasterPricing.FilterProcedureParameters();
                BufferMgr.TransferBuffer(filterProcedureParameter, _filterProcedureParameters, true);
                dbContext.FilterProcedureParameters.Add(_filterProcedureParameters);
                dbContext.SaveChanges();
                if (_filterProcedureParameters.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.MasterPricing.FilterProcedureParameter not created"));
                }
                filterProcedureParameterId = new FilterProcedureParameterId(_filterProcedureParameters.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.FilterProcedureParameter> filterProcedureParameterList, out List <Quest.Functional.MasterPricing.FilterProcedureParameter> filterProcedureParameterIdList)
        {
            // Initialize
            filterProcedureParameterIdList = null;


            // Perform create
            try
            {
                List <Quest.Services.Dbio.MasterPricing.FilterProcedureParameters> _filterProcedureParameterList = new List <Quest.Services.Dbio.MasterPricing.FilterProcedureParameters>();
                foreach (Quest.Functional.MasterPricing.FilterProcedureParameter filterProcedureParameter in filterProcedureParameterList)
                {
                    Quest.Services.Dbio.MasterPricing.FilterProcedureParameters _filterProcedureParameter = new Quest.Services.Dbio.MasterPricing.FilterProcedureParameters();
                    BufferMgr.TransferBuffer(filterProcedureParameter, _filterProcedureParameter);
                    _filterProcedureParameterList.Add(_filterProcedureParameter);
                }
                dbContext.FilterProcedureParameters.AddRange(_filterProcedureParameterList);
                dbContext.SaveChanges();

                filterProcedureParameterIdList = new List <FilterProcedureParameter>();
                foreach (Quest.Services.Dbio.MasterPricing.FilterProcedureParameters _filterProcedureParameter in _filterProcedureParameterList)
                {
                    Quest.Functional.MasterPricing.FilterProcedureParameter filterProcedureParameter = new FilterProcedureParameter();
                    filterProcedureParameter.Id = _filterProcedureParameter.Id;
                    filterProcedureParameterIdList.Add(filterProcedureParameter);
                }
            }
            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, FilterProcedureParameterId filterProcedureParameterId, out Quest.Functional.MasterPricing.FilterProcedureParameter filterProcedureParameter)
        {
            // Initialize
            questStatus status = null;

            filterProcedureParameter = null;


            // Perform read
            Quest.Services.Dbio.MasterPricing.FilterProcedureParameters _filterProcedureParameters = null;
            status = read((MasterPricingEntities)trans.DbContext, filterProcedureParameterId, out _filterProcedureParameters);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            filterProcedureParameter = new Quest.Functional.MasterPricing.FilterProcedureParameter();
            BufferMgr.TransferBuffer(_filterProcedureParameters, filterProcedureParameter);

            return(new questStatus(Severity.Success));
        }
        private questStatus read(MasterPricingEntities dbContext, FilterProcedureParameterId filterProcedureParameterId, out Quest.Services.Dbio.MasterPricing.FilterProcedureParameters filterProcedureParameter)
        {
            // Initialize
            filterProcedureParameter = null;


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