Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AreaOfKnowledge areaOfKnowledge = db.AreasOfKnowledge.Find(id);

            db.AreasOfKnowledge.Remove(areaOfKnowledge);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "AreaOfKnowledgeID,AreaOfKnowledgeName,Description,UserId")] AreaOfKnowledge areaOfKnowledge)
 {
     if (ModelState.IsValid)
     {
         db.Entry(areaOfKnowledge).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(areaOfKnowledge));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "AreaOfKnowledgeID,AreaOfKnowledgeName,Description,UserId")] AreaOfKnowledge areaOfKnowledge)
        {
            if (ModelState.IsValid)
            {
                db.AreasOfKnowledge.Add(areaOfKnowledge);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(areaOfKnowledge));
        }
Example #4
0
        // GET: AreaOfKnowledges/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AreaOfKnowledge areaOfKnowledge = db.AreasOfKnowledge.Find(id);

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