Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PhaseModels phaseModels = db.PhaseModels.Find(id);

            db.PhaseModels.Remove(phaseModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult DeletePhase(PhaseModels model)
        {
            var         id          = model.Id;
            PhaseModels phaseModels = db.PhaseModels.Find(id);

            phaseModels.Deleted = DateTime.Now;
            db.PhaseModels.AddOrUpdate(phaseModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
 public ActionResult Edit([Bind(Include = "Id,PhaseName")] PhaseModels phaseModels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(phaseModels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(phaseModels));
 }
Пример #4
0
        public ActionResult Create([Bind(Include = "Id,PhaseName")] PhaseModels phaseModels)
        {
            if (ModelState.IsValid)
            {
                db.PhaseModels.Add(phaseModels);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(phaseModels));
        }
Пример #5
0
        // GET: Phase/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PhaseModels phaseModels = db.PhaseModels.Find(id);

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