Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CenterAchievement centerAchievement = db.CenterAchievements.Find(id);

            db.CenterAchievements.Remove(centerAchievement);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "CenterAchievementId,Label,Text,Code")] CenterAchievement centerAchievement)
 {
     if (ModelState.IsValid)
     {
         centerAchievement.Code            = 2;
         db.Entry(centerAchievement).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(centerAchievement));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "CenterAchievementId,Label,Text,Code")] CenterAchievement centerAchievement)
        {
            if (ModelState.IsValid)
            {
                centerAchievement.Code = 2;
                db.CenterAchievements.Add(centerAchievement);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(centerAchievement));
        }
Exemple #4
0
        // GET: UniDecision/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CenterAchievement centerAchievement = db.CenterAchievements.Find(id);

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