예제 #1
0
        private questStatus update(MasterPricingEntities dbContext, Quest.Functional.MasterPricing.FilterValue filterValue)
        {
            // Initialize
            questStatus status = null;


            try
            {
                // Read the record.
                FilterValueId filterValueId = new FilterValueId(filterValue.Id);
                Quest.Services.Dbio.MasterPricing.FilterValues _filterValues = null;
                status = read(dbContext, filterValueId, out _filterValues);
                if (!questStatusDef.IsSuccess(status))
                {
                    return(status);
                }

                // Update the record.
                BufferMgr.TransferBuffer(filterValue, _filterValues);
                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));
        }
예제 #2
0
        /*----------------------------------------------------------------------------------------------------------------------------------
        * FilterColumns
        *---------------------------------------------------------------------------------------------------------------------------------*/
        private questStatus create(MasterPricingEntities dbContext, Quest.Functional.MasterPricing.FilterValue filterValue, out FilterValueId filterValueId)
        {
            // Initialize
            filterValueId = null;


            // Perform create
            try
            {
                Quest.Services.Dbio.MasterPricing.FilterValues _filterValues = new Quest.Services.Dbio.MasterPricing.FilterValues();
                BufferMgr.TransferBuffer(filterValue, _filterValues);
                dbContext.FilterValues.Add(_filterValues);
                dbContext.SaveChanges();
                if (_filterValues.Id == 0)
                {
                    return(new questStatus(Severity.Error, "Quest.Functional.MasterPricing.FilterValue not created"));
                }
                filterValueId = new FilterValueId(_filterValues.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));
        }
예제 #3
0
        private questStatus create(MasterPricingEntities dbContext, List <Quest.Functional.MasterPricing.FilterValue> filterValueList, out List <Quest.Functional.MasterPricing.FilterValue> filterValueIdList)
        {
            // Initialize
            filterValueIdList = null;


            // Perform create
            try
            {
                List <Quest.Services.Dbio.MasterPricing.FilterValues> _filterValueList = new List <Quest.Services.Dbio.MasterPricing.FilterValues>();
                foreach (Quest.Functional.MasterPricing.FilterValue filterValue in filterValueList)
                {
                    Quest.Services.Dbio.MasterPricing.FilterValues _filterValue = new Quest.Services.Dbio.MasterPricing.FilterValues();
                    BufferMgr.TransferBuffer(filterValue, _filterValue);
                    _filterValueList.Add(_filterValue);
                }
                dbContext.FilterValues.AddRange(_filterValueList);
                dbContext.SaveChanges();

                filterValueIdList = new List <FilterValue>();
                foreach (Quest.Services.Dbio.MasterPricing.FilterValues _filterValue in _filterValueList)
                {
                    Quest.Functional.MasterPricing.FilterValue filterValue = new FilterValue();
                    filterValue.Id = _filterValue.Id;
                    filterValueIdList.Add(filterValue);
                }
            }
            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));
        }
예제 #4
0
        public questStatus Read(DbMgrTransaction trans, FilterValueId filterValueId, out Quest.Functional.MasterPricing.FilterValue filterValue)
        {
            // Initialize
            questStatus status = null;

            filterValue = null;


            // Perform read
            Quest.Services.Dbio.MasterPricing.FilterValues _filterValues = null;
            status = read((MasterPricingEntities)trans.DbContext, filterValueId, out _filterValues);
            if (!questStatusDef.IsSuccess(status))
            {
                return(status);
            }
            filterValue = new Quest.Functional.MasterPricing.FilterValue();
            BufferMgr.TransferBuffer(_filterValues, filterValue);

            return(new questStatus(Severity.Success));
        }
예제 #5
0
        private questStatus read(MasterPricingEntities dbContext, FilterValueId filterValueId, out Quest.Services.Dbio.MasterPricing.FilterValues filterValue)
        {
            // Initialize
            filterValue = null;


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