Exemplo n.º 1
0
        public IHttpActionResult PutAction_Item(int id, Action_Item action_Item)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != action_Item.ActionItemID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Action_Item action_Item = db.Action_Items.Find(id);

            db.Action_Items.Remove(action_Item);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "ActionItemID,ActionItem_Title,Action_Description,project_Name,ActionDate,ActionTime,ActionAssignedTo,Status,Priority,MeetingID")] Action_Item action_Item)
 {
     if (ModelState.IsValid)
     {
         db.Entry(action_Item).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MeetingID = new SelectList(db.Meetings, "MeetingID", "project_Name", action_Item.MeetingID);
     return(View(action_Item));
 }
Exemplo n.º 4
0
        public IHttpActionResult GetAction_Item(int id)
        {
            Action_Item action_Item = db.Action_Items.Find(id);

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

            return(Ok(action_Item));
        }
Exemplo n.º 5
0
        public IHttpActionResult PostAction_Item(Action_Item action_Item)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Action_Items.Add(action_Item);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = action_Item.ActionItemID }, action_Item));
        }
Exemplo n.º 6
0
        // GET: ActionMVC/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Action_Item action_Item = db.Action_Items.Find(id);

            if (action_Item == null)
            {
                return(HttpNotFound());
            }
            return(View(action_Item));
        }
Exemplo n.º 7
0
        public IHttpActionResult DeleteAction_Item(int id)
        {
            Action_Item action_Item = db.Action_Items.Find(id);

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

            db.Action_Items.Remove(action_Item);
            db.SaveChanges();

            return(Ok(action_Item));
        }
Exemplo n.º 8
0
        // GET: ActionMVC/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Action_Item action_Item = db.Action_Items.Find(id);

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