예제 #1
0
        public void ChangeDiseaseInMember(int membId, int diseaseId, HaveDiseases disease)
        {
            HaveDiseases diseases = Uow.HaveDiseaseRepository.GetDiseaseByIdMember(membId, diseaseId);

            diseases.Dominant      = disease.Dominant;
            diseases.GenDiseasesId = disease.GenDiseasesId;
        }
예제 #2
0
        public void AddDiseaseToMember(int diseaseId, int memberId)
        {
            HaveDiseases linkDisease = new HaveDiseases();

            linkDisease.MemberId      = memberId;
            linkDisease.GenDiseasesId = diseaseId;
            linkDisease.Dominant      = false;
            Uow.HaveDiseaseRepository.Add(linkDisease);
        }
예제 #3
0
        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());
        }