public ActionResult DeleteConfirmed(int id)
        {
            CommitteeType committeetype = db.CommitteeTypes.Find(id);

            db.CommitteeTypes.Remove(committeetype);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //
        // GET: /Admin/CommitteeType/Delete/5

        public ActionResult Delete(int id = 0)
        {
            CommitteeType committeetype = db.CommitteeTypes.Find(id);

            if (committeetype == null)
            {
                return(HttpNotFound());
            }
            return(View(committeetype));
        }
 public ActionResult Edit(CommitteeType committeetype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(committeetype).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(committeetype));
 }
Example #4
0
        public void Should_Construct_CommitteeType()
        {
            CommitteeType committeeType = new CommitteeType();

            _ = committeeType.CommitteeTypeId;
            _ = committeeType.NameAr;
            _ = committeeType.NameEn;
            _ = committeeType.Committees;

            committeeType.ShouldNotBeNull();
        }
        public ActionResult Create(CommitteeType committeetype)
        {
            if (ModelState.IsValid)
            {
                db.CommitteeTypes.Add(committeetype);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(committeetype));
        }