public RiskAssessment DeleteRiskAssessment(RiskAssessment riskAssessment)
 {
     var riskAssessmentDAL = MappingHelper.RiskAssessmentWCFToDAL(riskAssessment);
     if (riskAssessmentDAL != null)
     {
         riskAssessmentDAL = _db.RiskAssessments.Remove(riskAssessmentDAL);
     }
     _db.SaveChanges();
     return MappingHelper.RiskAssessmentDALToWCF(riskAssessmentDAL);
 }
 public RiskAssessment CreateRiskAssessment(RiskAssessment riskAssessment)
 {
     var newRiskAssessment = MappingHelper.RiskAssessmentWCFToDAL(riskAssessment);
     if (newRiskAssessment != null)
     {
         newRiskAssessment = _db.RiskAssessments.Add(newRiskAssessment);
     }
     _db.SaveChanges();
     return MappingHelper.RiskAssessmentDALToWCF(newRiskAssessment);
 }
 public RiskAssessment UpdateRiskAssessment(RiskAssessment updatedRiskAssessment)
 {
     var riskAssessment = _db.RiskAssessments
         .OrderByDescending(ra => ra.ID)
         .FirstOrDefault(ra => ra.SupplyReference == updatedRiskAssessment.SupplyReference);
     riskAssessment.LocalAuthority = updatedRiskAssessment.LocalAuthority;
     riskAssessment.SupplyName = updatedRiskAssessment.SupplyName;
     riskAssessment.SupplyReference = updatedRiskAssessment.SupplyReference;
     _db.SaveChanges();
     return MappingHelper.RiskAssessmentDALToWCF(riskAssessment);
 }
Exemplo n.º 4
0
 public RiskAssessment UpdateRiskAssessment(RiskAssessment updatedRiskAssessment)
 {
     return _riskAssessmentService.UpdateRiskAssessment(updatedRiskAssessment);
 }
Exemplo n.º 5
0
 public RiskAssessment DeleteRiskAssessment(RiskAssessment riskAssessment)
 {
     return _riskAssessmentService.DeleteRiskAssessment(riskAssessment);
 }
Exemplo n.º 6
0
 public RiskAssessment CreateRiskAssessment(RiskAssessment riskAssessment)
 {
     return _riskAssessmentService.CreateRiskAssessment(riskAssessment);
 }