예제 #1
0
 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"));
     }
 }
예제 #2
0
 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"));
 }