예제 #1
0
        public IHttpActionResult PutDecision_Item(int id, Decision_Item decision_Item)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != decision_Item.DecisionItemID)
            {
                return(BadRequest());
            }

            db.Entry(decision_Item).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Decision_ItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Decision_Item decision_Item = db.Decision_Items.Find(id);

            db.Decision_Items.Remove(decision_Item);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
 public ActionResult Edit([Bind(Include = "DecisionItemID,DecisionItem_Title,project_Name,Description,DecisionDate,DecisionTime,DecisionAssignedTo,Priority,Status,MeetingID")] Decision_Item decision_Item)
 {
     if (ModelState.IsValid)
     {
         db.Entry(decision_Item).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MeetingID = new SelectList(db.Meetings, "MeetingID", "project_Name", decision_Item.MeetingID);
     return(View(decision_Item));
 }
예제 #4
0
        public IHttpActionResult GetDecision_Item(int id)
        {
            Decision_Item decision_Item = db.Decision_Items.Find(id);

            if (decision_Item == null)
            {
                return(NotFound());
            }

            return(Ok(decision_Item));
        }
예제 #5
0
        public IHttpActionResult PostDecision_Item(Decision_Item decision_Item)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Decision_Items.Add(decision_Item);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = decision_Item.DecisionItemID }, decision_Item));
        }
예제 #6
0
        // GET: Decision_Item/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Decision_Item decision_Item = db.Decision_Items.Find(id);

            if (decision_Item == null)
            {
                return(HttpNotFound());
            }
            return(View(decision_Item));
        }
예제 #7
0
        public IHttpActionResult DeleteDecision_Item(int id)
        {
            Decision_Item decision_Item = db.Decision_Items.Find(id);

            if (decision_Item == null)
            {
                return(NotFound());
            }

            db.Decision_Items.Remove(decision_Item);
            db.SaveChanges();

            return(Ok(decision_Item));
        }
예제 #8
0
        // GET: Decision_Item/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Decision_Item decision_Item = db.Decision_Items.Find(id);

            if (decision_Item == null)
            {
                return(HttpNotFound());
            }
            ViewBag.MeetingID = new SelectList(db.Meetings, "MeetingID", "project_Name", decision_Item.MeetingID);
            return(View(decision_Item));
        }