예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Complaint_Catgories complaint_Catgories = db.Complaint_Catgories.Find(id);

            db.Complaint_Catgories.Remove(complaint_Catgories);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,Cat_Name")] Complaint_Catgories complaint_Catgories)
 {
     if (ModelState.IsValid)
     {
         db.Entry(complaint_Catgories).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(complaint_Catgories));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "id,Cat_Name")] Complaint_Catgories complaint_Catgories)
        {
            if (ModelState.IsValid)
            {
                db.Complaint_Catgories.Add(complaint_Catgories);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(complaint_Catgories));
        }
예제 #4
0
        // GET: Complaint_Catgories/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Complaint_Catgories complaint_Catgories = db.Complaint_Catgories.Find(id);

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