コード例 #1
0
 public ActionResult Edit([Bind(Include = "AracRenk_ID,AracRenk_Adi,AracRenk_Status,AracRenk_CreateDate")] AracRenk aracRenk)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aracRenk).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aracRenk));
 }
コード例 #2
0
        public ActionResult Create([Bind(Include = "AracRenk_ID,AracRenk_Adi,AracRenk_Status,AracRenk_CreateDate")] AracRenk aracRenk)
        {
            if (ModelState.IsValid)
            {
                aracRenk.AracRenk_Status     = (int)DBStatus.Active;
                aracRenk.AracRenk_CreateDate = DateTime.Now;
                db.AracRenk.Add(aracRenk);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aracRenk));
        }
コード例 #3
0
        // GET: AracRenk/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AracRenk aracRenk = db.AracRenk.Find(id);

            if (aracRenk == null)
            {
                return(HttpNotFound());
            }
            return(View(aracRenk));
        }
コード例 #4
0
        // GET: AracRenk/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AracRenk aracRenk = db.AracRenk.Find(id);

            if (aracRenk == null)
            {
                return(HttpNotFound());
            }
            aracRenk.AracRenk_Status = (int)DBStatus.Deleted;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }