Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Mst_CommPlan mst_CommPlan = db.Mst_CommPlans.Find(id);

            db.Mst_CommPlans.Remove(mst_CommPlan);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "CommPlanid,CommPlanDesc,isActive")] Mst_CommPlan mst_CommPlan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mst_CommPlan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mst_CommPlan));
 }
Ejemplo n.º 3
0
        // GET: CommPlan/Delete/5
        public ActionResult Delete(int?id)
        {
            Mst_CommPlan user = db.Mst_CommPlans.Find(id);

            if (user == null)
            {
                return(HttpNotFound());
            }
            return(View(user));
        }
Ejemplo n.º 4
0
        // GET: CommPlan/Details/5
        public ActionResult Details(int?id)
        {
            Mst_CommPlan mstcommplan = db.Mst_CommPlans.Find(id);

            if (mstcommplan == null)
            {
                return(HttpNotFound());
            }
            return(View(mstcommplan));
        }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "CommPlanid,CommPlanDesc,isActive")] Mst_CommPlan mst_CommPlan)
        {
            if (ModelState.IsValid)
            {
                db.Mst_CommPlans.Add(mst_CommPlan);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mst_CommPlan));
        }
Ejemplo n.º 6
0
        // GET: Commitment/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mst_CommPlan mst_CommPlan = db.Mst_CommPlans.Find(id);

            if (mst_CommPlan == null)
            {
                return(HttpNotFound());
            }
            return(View(mst_CommPlan));
        }
Ejemplo n.º 7
0
        // GET: CommPlan/Edit/5
        public ActionResult Edit(int?id)
        {
            Mst_CommPlan mstcomplan = db.Mst_CommPlans.Find(id);

            if (id == null)
            {
                return(HttpNotFound());
            }
            //string data = mstperform.ToString();
            //return View(mstperform);
            string data = mstcomplan.ToString();

            return(View(mstcomplan));
        }
Ejemplo n.º 8
0
 public ActionResult Delete(int?id, Mst_CommPlan test)
 {
     try
     {
         Mst_CommPlan mstp = db.Mst_CommPlans.Find(id);
         //return Json(mstp,JsonRequestBehavior.AllowGet);
         db.Mst_CommPlans.Remove(mstp);
         db.SaveChanges();
         return(RedirectToAction("index"));
     }
     catch (DbUpdateException)
     {
         ViewBag.message = "Delete failed. Please check if record is used by another table.";
         Mst_CommPlan mstp2 = db.Mst_CommPlans.Find(id);
         return(View(mstp2));
     }
 }
Ejemplo n.º 9
0
        public ActionResult Create(Mst_CommPlan add)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    db.Mst_CommPlans.Add(add);
                    db.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 10
0
        public ActionResult Edit(int?id, Mst_CommPlan cEdit)
        {
            try
            {
                // TODO: Add update logic here
                if (id == null)
                {
                    return(HttpNotFound());
                }
                Mst_CommPlan mstcomplan = db.Mst_CommPlans.Find(id);
                mstcomplan.CommPlanid   = cEdit.CommPlanid;
                mstcomplan.CommPlanDesc = cEdit.CommPlanDesc;
                mstcomplan.isActive     = cEdit.isActive;
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }