private questStatus update(MasterPricingEntities dbContext, Quest.Functional.MasterPricing.FilterOperator filterOperator) { // Initialize questStatus status = null; try { // Read the record. FilterOperatorId filterOperatorId = new FilterOperatorId(filterOperator.Id); Quest.Services.Dbio.MasterPricing.FilterOperators _filterOperators = null; status = read(dbContext, filterOperatorId, out _filterOperators); if (!questStatusDef.IsSuccess(status)) { return(status); } // Update the record. BufferMgr.TransferBuffer(filterOperator, _filterOperators); 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.FilterOperator filterOperator, out FilterOperatorId filterOperatorId) { // Initialize filterOperatorId = null; // Perform create try { Quest.Services.Dbio.MasterPricing.FilterOperators _filterOperators = new Quest.Services.Dbio.MasterPricing.FilterOperators(); BufferMgr.TransferBuffer(filterOperator, _filterOperators); dbContext.FilterOperators.Add(_filterOperators); dbContext.SaveChanges(); if (_filterOperators.Id == 0) { return(new questStatus(Severity.Error, "Quest.Functional.MasterPricing.FilterOperator not created")); } filterOperatorId = new FilterOperatorId(_filterOperators.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.FilterOperator> filterOperatorList, out List <Quest.Functional.MasterPricing.FilterOperator> filterOperatorIdList) { // Initialize filterOperatorIdList = null; // Perform create try { List <Quest.Services.Dbio.MasterPricing.FilterOperators> _filterOperatorList = new List <Quest.Services.Dbio.MasterPricing.FilterOperators>(); foreach (Quest.Functional.MasterPricing.FilterOperator filterOperator in filterOperatorList) { Quest.Services.Dbio.MasterPricing.FilterOperators _filterOperator = new Quest.Services.Dbio.MasterPricing.FilterOperators(); BufferMgr.TransferBuffer(filterOperator, _filterOperator); _filterOperatorList.Add(_filterOperator); } dbContext.FilterOperators.AddRange(_filterOperatorList); dbContext.SaveChanges(); filterOperatorIdList = new List <FilterOperator>(); foreach (Quest.Services.Dbio.MasterPricing.FilterOperators _filterOperator in _filterOperatorList) { Quest.Functional.MasterPricing.FilterOperator filterOperator = new FilterOperator(); filterOperator.Id = _filterOperator.Id; filterOperatorIdList.Add(filterOperator); } } 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, FilterOperatorId filterOperatorId, out Quest.Functional.MasterPricing.FilterOperator filterOperator) { // Initialize questStatus status = null; filterOperator = null; // Perform read Quest.Services.Dbio.MasterPricing.FilterOperators _filterOperators = null; status = read((MasterPricingEntities)trans.DbContext, filterOperatorId, out _filterOperators); if (!questStatusDef.IsSuccess(status)) { return(status); } filterOperator = new Quest.Functional.MasterPricing.FilterOperator(); BufferMgr.TransferBuffer(_filterOperators, filterOperator); return(new questStatus(Severity.Success)); }
private questStatus read(MasterPricingEntities dbContext, FilterOperatorId filterOperatorId, out Quest.Services.Dbio.MasterPricing.FilterOperators filterOperator) { // Initialize filterOperator = null; try { filterOperator = dbContext.FilterOperators.Where(r => r.Id == filterOperatorId.Id).SingleOrDefault(); if (filterOperator == null) { return(new questStatus(Severity.Error, String.Format("ERROR: {0}.{1}: {2}", this.GetType().Name, MethodBase.GetCurrentMethod().Name, String.Format("Id {0} not found", filterOperatorId.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)); }