コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CadreMaster cadreMaster = db.CadreMasters.Find(id);

            db.CadreMasters.Remove(cadreMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "CadreId,CadreName,CreatedDate,IsDeleted")] CadreMaster cadreMaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cadreMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cadreMaster));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "CadreId,CadreName,CreatedDate,IsDeleted")] CadreMaster cadreMaster)
        {
            if (ModelState.IsValid)
            {
                db.CadreMasters.Add(cadreMaster);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

            if (cadreMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(cadreMaster));
        }