// GET: Potansiyels/Edit/5 public ActionResult Edit(int?id) { if (Session["KullaniciID"] != null) { if (id == null) { return(RedirectToAction("_404", "Home")); } Potansiyel potansiyel = db.Potansiyel.Find(id); if (potansiyel == null) { return(RedirectToAction("_404", "Home")); } ViewBag.Yetkili = new SelectList(db.Yetkili.Where(x => x.GosterimDurumu != "0"), "Id", "FullName"); ViewBag.Sektor = new SelectList(db.Sektor.Where(x => x.GosterimDurumu != "0"), "Id", "SektorAd"); ViewBag.Ulke = new SelectList(db.Ulkeler, "Id", "UlkeAdi"); ViewBag.Il = new SelectList(db.Iller, "Id", "IlAdi"); ViewBag.SatisElemani = new SelectList(db.SatisElemanlari.Where(x => x.GosterimDurumu != "0"), "Id", "SatisElemaniAdiSoyadi"); return(View(potansiyel)); } else { return(RedirectToAction("LoginPage", "Home")); } }
public ActionResult Create([Bind(Include = "ID,PotansiyelKodu,PotansiyelUnvani,PotansiyelAdresi,PotansiyelAdresiUINKodu,PotansiyelYetkiliID,PotansiyelAdresGpsEnlem,PotansiyelAdresGpsBoylam,PotansiyelUlkeKodu,PotansiyelIl,PotansiyelIlce,PotansiyelVergiDairesi,PotansiyelVergiNumarasi,PotansiyelEmail,PotansiyelWebAdresi,PotansiyelSektorID,PotansiyelNot,PotansiyelSatisElemani")] Potansiyel potansiyel) { if (ModelState.IsValid) { db.Potansiyel.Add(potansiyel); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Yetkili = new SelectList(db.Yetkili.Where(x => x.GosterimDurumu != "0"), "Id", "FullName"); ViewBag.Sektor = new SelectList(db.Sektor.Where(x => x.GosterimDurumu != "0"), "Id", "SektorAd"); ViewBag.Ulke = new SelectList(db.Ulkeler, "Id", "UlkeAdi"); ViewBag.Il = new SelectList(db.Iller, "Id", "IlAdi"); ViewBag.SatisElemani = new SelectList(db.SatisElemanlari.Where(x => x.GosterimDurumu != "0"), "Id", "SatisElemaniAdiSoyadi"); return(View(potansiyel)); }
public ActionResult DeleteConfirmed(int id) { if (Session["KullaniciID"] != null) { Potansiyel potansiyel = db.Potansiyel.Find(id); potansiyel.GosterimDurumu = "0"; //db.Potansiyel.Remove(potansiyel); db.SaveChanges(); return(RedirectToAction("Index")); } else { return(RedirectToAction("LoginPage", "Home")); } }
// GET: Potansiyels/Details/5 public ActionResult Details(int?id) { if (Session["KullaniciID"] != null) { if (id == null) { return(RedirectToAction("_404", "Home")); } Potansiyel potansiyel = db.Potansiyel.Find(id); if (potansiyel == null) { return(RedirectToAction("_404", "Home")); } return(View(potansiyel)); } else { return(RedirectToAction("LoginPage", "Home")); } }