コード例 #1
0
 public ActionResult Edit([Bind(Include = "AracGrup_ID,AracGrup_Adi,AracGrup_Status,AracGrup_CreateDate")] AracGrup aracGrup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aracGrup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aracGrup));
 }
コード例 #2
0
        public ActionResult Create([Bind(Include = "AracGrup_ID,AracGrup_Adi,AracGrup_Status,AracGrup_CreateDate")] AracGrup aracGrup)
        {
            if (ModelState.IsValid)
            {
                aracGrup.AracGrup_Status     = (int)DBStatus.Active;
                aracGrup.AracGrup_CreateDate = DateTime.Now;
                db.AracGrup.Add(aracGrup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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

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