public void ChangeDiseaseInMember(int membId, int diseaseId, HaveDiseases disease) { HaveDiseases diseases = Uow.HaveDiseaseRepository.GetDiseaseByIdMember(membId, diseaseId); diseases.Dominant = disease.Dominant; diseases.GenDiseasesId = disease.GenDiseasesId; }
public void AddDiseaseToMember(int diseaseId, int memberId) { HaveDiseases linkDisease = new HaveDiseases(); linkDisease.MemberId = memberId; linkDisease.GenDiseasesId = diseaseId; linkDisease.Dominant = false; Uow.HaveDiseaseRepository.Add(linkDisease); }
public async Task <IHttpActionResult> ChangeDiseaseinMember(HaveDiseaseBindingModel model) { UnitOfWork uow = new UnitOfWork(new ApplicationDbContext()); MemberService service = new MemberService(uow); HaveDiseases disease = new HaveDiseases() { MemberId = model.MemberId, Dominant = model.Dominante, GenDiseasesId = model.DiseaseId }; service.ChangeDiseaseInMember(model.MemberId, model.CurrentDiseaseId, disease); uow.Commit(); return(Ok()); }