Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TBL_BLOG tBL_BLOG = db.TBL_BLOG.Find(id);

            db.TBL_BLOG.Remove(tBL_BLOG);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID,BASLIK,TARIH,ICERIK")] TBL_BLOG tBL_BLOG)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tBL_BLOG).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tBL_BLOG));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "ID,BASLIK,TARIH,ICERIK")] TBL_BLOG tBL_BLOG)
        {
            if (ModelState.IsValid)
            {
                db.TBL_BLOG.Add(tBL_BLOG);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tBL_BLOG));
        }
Example #4
0
        // GET: YoneticiBlog/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TBL_BLOG tBL_BLOG = db.TBL_BLOG.Find(id);

            if (tBL_BLOG == null)
            {
                return(HttpNotFound());
            }
            return(View(tBL_BLOG));
        }
Example #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            TBL_BLOG t = new TBL_BLOG();

            t.BlogBaslik   = TextBox1.Text;
            t.BlogTarih    = DateTime.Parse(TextBox2.Text);
            t.BlogGorsel   = TextBox3.Text;
            t.BlogTur      = byte.Parse(DropDownList1.SelectedValue);
            t.BlogKategori = byte.Parse(DropDownList2.SelectedValue);
            t.BlogIcerik   = TextBox4.Text;
            db.TBL_BLOG.Add(t);
            db.SaveChanges();
            Response.Redirect("Bloglar.aspx");
        }