예제 #1
0
        public async Task <IHttpActionResult> GetDiseaseById(int diseaseId)
        {
            UnitOfWork        uow     = new UnitOfWork(new ApplicationDbContext());
            GenDiseaseService service = new GenDiseaseService(uow);
            GenDiseases       disease = service.GetGenDiseasesById(diseaseId);

            return(await Task.FromResult(Ok(disease)));
        }
예제 #2
0
        public void CheangeDisease(GenDiseases newDisease)
        {
            var currentDisease = Uow.GenDiseasesRepository.GetById(newDisease.Id);

            currentDisease.About          = newDisease.About;
            currentDisease.MenInherited   = newDisease.MenInherited;
            currentDisease.WomenInherited = newDisease.WomenInherited;
            currentDisease.Name           = newDisease.Name;
        }
예제 #3
0
        public async Task <IHttpActionResult> ChangeDisease(GenDiseases model)
        {
            UnitOfWork        uow     = new UnitOfWork(new ApplicationDbContext());
            GenDiseaseService service = new GenDiseaseService(uow);

            service.CheangeDisease(model);
            uow.Commit();
            return(Ok());
        }
예제 #4
0
        public async Task <IHttpActionResult> AddGenDisease(AddGenDiseasesBindingModel model)
        {
            UnitOfWork        uow     = new UnitOfWork(new ApplicationDbContext());
            GenDiseaseService service = new GenDiseaseService(uow);
            var diseases = new GenDiseases()
            {
                Name           = model.Name,
                About          = model.About,
                MenInherited   = model.MenInherited,
                WomenInherited = model.WomenInherited
            };

            service.AddNewDisease(diseases);
            uow.Commit();
            return(Ok());
        }
예제 #5
0
 public void AddNewDisease(GenDiseases disease)
 {
     Uow.GenDiseasesRepository.Add(disease);
 }