Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CenterRule centerRule = db.CenterRules.Find(id);

            db.CenterRules.Remove(centerRule);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "CenterRuleId,Text")] CenterRule centerRule)
 {
     if (ModelState.IsValid)
     {
         centerRule.Code            = 1;
         db.Entry(centerRule).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(centerRule));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "CenterRuleId,Text")] CenterRule centerRule)
        {
            if (ModelState.IsValid)
            {
                centerRule.Code = 1;
                db.CenterRules.Add(centerRule);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(centerRule));
        }
Ejemplo n.º 4
0
        // GET: CenterRule/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CenterRule centerRule = db.CenterRules.Find(id);

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