public EvidenceDataObject AddEvidence(EvidenceDataObject evidence) { Evidence entity = this.evidenceRepository.Create(); entity = DyMapper.Map(evidence, entity); entity.Filing = this.evidenceRepository.Context.DoGet <Filing>(p => p.ID == evidence.FilingID).FirstOrDefault(); this.evidenceRepository.Add(entity); this.evidenceRepository.Commit(); return(DyMapper.Map <Evidence, EvidenceDataObject>(entity)); }
public EvidenceDataObject UpdateEvidence(EvidenceDataObject evidence) { Evidence entity = this.evidenceRepository.FindByID(evidence.ID); entity = DyMapper.Map(evidence, entity); entity.EvidenceDetail.Clear(); List <EvidenceDetail> detailList = this.evidenceRepository.Context.DoGet <EvidenceDetail>(p => evidence.EvidenceDetailIDList.Contains(p.ID)).ToList(); detailList.ForEach((item) => { entity.EvidenceDetail.Add(item); }); this.evidenceRepository.Update(entity); this.evidenceRepository.Commit(); return(DyMapper.Map <Evidence, EvidenceDataObject>(entity)); }
public JsonResult <EvidenceDataObject> AddEvidence(EvidenceDataObject evidence) { return(Json(this.evidenceService.AddEvidence(evidence))); }