public IActionResult GuncelleHasta(int id) { TempData["active"] = "hasta"; ViewBag.Aciliyetler = new SelectList(_aciliyetService.GetirHepsi(), "Id", "Tanim"); var hasta = _hastaService.GetirIdile(id); HastaUpdateViewModel model = new HastaUpdateViewModel(); model.AdSoyad = hasta.AdSoyad; model.KimlikNo = hasta.KimlikNo; model.DogumTarihi = hasta.DogumTarihi; model.Aciklama = hasta.Aciklama; model.AciliyetId = hasta.AciliyetId; return(View(model)); }
public IActionResult EkipGorevlendir(GorevlendirEkipViewModel model) { var guncellenecekHasta = _hastaService.GetirIdile(model.HastaId); guncellenecekHasta.AppUserId = model.UserId; _hastaService.Guncelle(guncellenecekHasta); _bildirimService.Ekle(new Bildirim() { AppUserId = model.UserId, Mesaj = guncellenecekHasta.KimlikNo + " kimlik numaralı hasta için görevlendirildiniz." }); return(RedirectToAction("Index")); }
public async Task <IActionResult> Tamamlandi(int id) { var hasta = _hastaService.GetirIdile(id); hasta.Durum = true; _hastaService.Guncelle(hasta); var aktifEkip = await _userManager.FindByNameAsync(User.Identity.Name); var adminler = await _userManager.GetUsersInRoleAsync("admin"); foreach (var admin in adminler) { _bildirimService.Ekle(new Bildirim() { AppUserId = admin.Id, Mesaj = aktifEkip.UserName + " adlı ekip bir hastayı iyileştirdi." }); } return(RedirectToAction("Index")); }