public ActionResult Delete(int id, rehber rehberModel) { try { return(View()); } catch { return(View()); } }
public static bool KullaniciKontrolEt(int id, rehber rehberModel, string kullaniciAdi) { if (rehberModel == null) { return(false); } else { if (rehberModel.kullanici.kullanici_adi != kullaniciAdi) { return(false); } else { return(true); } } }
public ActionResult Edit(int id, rehber rehberModel) { try { var rehber = rehberDB.rehbers .Where(i => i.id == id) .SingleOrDefault(); rehber.ad = rehberModel.ad; rehber.soyad = rehberModel.soyad; rehber.telefon = rehberModel.telefon; rehberDB.SaveChanges(); return(RedirectToAction("GetNumbers", "Rehber")); } catch { return(View()); } }
public ActionResult Create(rehber rehberModel) { try { string kullaniciAdi = Session["username"].ToString(); var kullaniciID = rehberDB.kullanicis .Where(i => i.kullanici_adi == kullaniciAdi) .SingleOrDefault() .id; rehberModel.kullanici_id = kullaniciID; rehberDB.rehbers.Add(rehberModel); rehberDB.SaveChanges(); return(RedirectToAction("Index", "Kullanici")); } catch { return(View()); } }