public JavaScriptResult ZiyaretOlustur(DoktorZiyaret dz) { try { Doktor ben = (Session["doktor"] as Doktor); FirmaDoktor fd = db.FirmaDoktors.FirstOrDefault(x => x.FirmaID == dz.FirmaID && x.DoktorID == ben.Id); if (fd == null) { return(hata("Sizin bu firmada bir yetkiniz bulunmuyor")); } DoktorZiyaret eskidz = db.DoktorZiyarets.FirstOrDefault(x => x.FirmaID == dz.FirmaID && x.DoktorID == ben.Id); if (eskidz != null) { return(onayYonlendir("Bu firma için açılmış bir kaydınız zaten bulunuyor. Firma işlemlerine yönlendirileceksiniz", "/Doktor/ZiyaretIslemleri/" + eskidz.Id)); } dz.Tarih = DateTime.Now; dz.DoktorID = ben.Id; db.DoktorZiyarets.Add(dz); db.SaveChanges(); return(onayYonlendir("Ziyaret başarıyla tamamlandı. İşlemlere yönlendirileceksiniz", "/Doktor/ZiyaretIslemleri/" + dz.Id)); } catch { return(hata("Bir hata oluştu")); } }
public JavaScriptResult YeniNotOlustur(DoktorNot dn) { try { Doktor ben = Session["doktor"] as Doktor; DoktorZiyaret dz = db.DoktorZiyarets.Find(dn.DoktorZiyaretID); dn.EklenmeTarihi = DateTime.Now; db.DoktorNots.Add(dn); db.SaveChanges(); return(ScriptVeOnay("$('#mdlYeniNot').modal('hide');", "Not başarıyla kaydedildi.")); } catch (Exception) { return(hata("Not kaydedilemedi. Lütfen tüm alanları doldurun")); } }
public ActionResult RaporIcerik(int?id) { try { SaglikRaporu rapor = db.SaglikRaporus.Find(id); DoktorZiyaret dz = rapor.DoktorZiyaret; Doktor ben = Session["doktor"] as Doktor; if (dz.DoktorID == ben.Id) { return(View(rapor)); } } catch { } return(RedirectToAction("Raporlarim")); }
public JavaScriptResult RaporOlustur(SaglikRaporu rapor) { try { DoktorZiyaret dz = db.DoktorZiyarets.Find(rapor.ZiyaretID); Doktor ben = Session["doktor"] as Doktor; if (dz.DoktorID == ben.Id) { rapor.Tarih = DateTime.Now; db.SaglikRaporus.Add(rapor); db.SaveChanges(); return(onayYonlendir("Rapor başarıyla oluşturuldu. Rapor içerik sayfasına yönlendiriliyorsunuz.", "/Doktor/RaporIcerik/" + rapor.Id)); } } catch { } return(hata("Rapor oluşturulamadı. Lütfen tüm bilgilerin doğruluğundan ve yetkinizin olduğundan emin olup tekrar deneyin")); }
public ActionResult YeniRapor(int?id) { try { DoktorZiyaret dz = db.DoktorZiyarets.Find(id); Doktor ben = Session["doktor"] as Doktor; FirmaDoktor fd = db.FirmaDoktors.FirstOrDefault(x => x.FirmaID == dz.FirmaID && dz.DoktorID == ben.Id); if (fd != null) { return(View(dz)); } } catch { } return(RedirectToAction("Ziyaretlerim")); }
public JavaScriptResult NotSil(int?notid) { try { Doktor ben = Session["doktor"] as Doktor; DoktorNot dn = db.DoktorNots.FirstOrDefault(x => x.Id == notid); DoktorZiyaret dz = dn.DoktorZiyaret; if (dz.DoktorID == ben.Id) { db.DoktorNots.Remove(dn); db.SaveChanges(); return(onayyenile("Not başarıyla silindi")); } } catch { } return(hata("Bu not sizin yetki alanınızda görünmüyor")); }
public ActionResult ZiyaretIslemleri(int?id) { try { Doktor ben = Session["doktor"] as Doktor; DoktorZiyaret dz = db.DoktorZiyarets.Find(id); if (dz.DoktorID != ben.Id) { return(RedirectToAction("Ziyaretlerim")); } Firma firma = dz.Firma; FirmaDoktor fd = db.FirmaDoktors.FirstOrDefault(x => x.FirmaID == firma.Id && x.DoktorID == ben.Id); if (fd == null) { return(RedirectToAction("Ziyaretlerim")); } return(View(dz)); } catch { } return(RedirectToAction("Ziyaretlerim")); }