} // CreateRisk public Risk UpdateRisk(Guid guid, Risk update) { Risk risk = Risk(guid); if (risk == null) return null; risk.CopyFrom(update); Commit(risk); currentRisks_ = null; return risk; } // UpdateRisk
} // UpdateRisk public Risk DeleteRisk(Guid guid) { Risk risk = Risk(guid); if (risk == null) return null; risk.Deleted = true; Commit(risk); currentRisks_ = null; return risk; } // DeleteRisk
} // Risk public Risk CreateRisk(Risk newRisk) { Risk r = new Risk(); r.Id = Guid.NewGuid(); r.Deleted = false; r.CopyFrom(newRisk); r.OwningOrganisation = orgId_; context.Risks.Add(r); Commit(); currentRisks_ = null; return r; } // CreateRisk
public void CopyFrom(Risk other) { Title = other.Title; Score = other.Score; Theme = other.Theme; Category = other.Category; Guidance = other.Guidance; Grouping = other.Grouping; NIHCEG = other.NIHCEG; IOST = other.IOST; HCP = other.HCP; SJOF = other.SJOF; ASCOF = other.ASCOF; OwningOrganisation = other.OwningOrganisation; } // CopyFrom