Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AlinanNot alinanNot = db.AlinanNots.Find(id);

            db.AlinanNots.Remove(alinanNot);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Yazi,KategoriId")] AlinanNot alinanNot)
 {
     if (ModelState.IsValid)
     {
         db.Entry(alinanNot).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.KategoriId = new SelectList(db.Kategoris, "Id", "KategoriAdi", alinanNot.KategoriId);
     return(View(alinanNot));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Yazi,KategoriId")] AlinanNot alinanNot)
        {
            if (ModelState.IsValid)
            {
                db.AlinanNots.Add(alinanNot);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.KategoriId = new SelectList(db.Kategoris, "Id", "KategoriAdi", alinanNot.KategoriId);
            return(View(alinanNot));
        }
Exemplo n.º 4
0
        // GET: AlinanNot/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AlinanNot alinanNot = db.AlinanNots.Find(id);

            if (alinanNot == null)
            {
                return(HttpNotFound());
            }
            return(View(alinanNot));
        }
Exemplo n.º 5
0
        // GET: AlinanNot/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AlinanNot alinanNot = db.AlinanNots.Find(id);

            if (alinanNot == null)
            {
                return(HttpNotFound());
            }
            ViewBag.KategoriId = new SelectList(db.Kategoris, "Id", "KategoriAdi", alinanNot.KategoriId);
            return(View(alinanNot));
        }