public void AddOverride(RequirementWrapper wrapper) { Requirement newOverride = new Requirement { Description = wrapper.RequirementInstance.Description, IsOverride = true, MethodVariantID = wrapper.RequirementInstance.MethodVariantID, OverriddenID = wrapper.RequirementInstance.ID, SpecificationVersionID = SpecificationVersionInstance.ID }; foreach (SubRequirement subReq in wrapper.RequirementInstance.SubRequirements) { SubRequirement tempSub = new SubRequirement { SubMethodID = subReq.SubMethodID, RequiredValue = subReq.RequiredValue }; newOverride.SubRequirements.Add(tempSub); } _labDbData.Execute(new InsertEntityCommand(newOverride)); wrapper.RequirementInstance = newOverride; }
private void RemoveOverride(RequirementWrapper wrapper) { int overrID = (int)wrapper.RequirementInstance.OverriddenID; _labDbData.Execute(new DeleteEntityCommand(wrapper.RequirementInstance)); wrapper.RequirementInstance = _labDbData.RunQuery(new RequirementsQuery() { OrderResults = false, EagerLoadingEnabled = false }) .FirstOrDefault(req => req.ID == overrID); }