Example #1
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            Mst_CommPlan_Detail mstp = db.Mst_CommPlan_Details.Find(id);

            //return Json(mstp,JsonRequestBehavior.AllowGet);
            db.Mst_CommPlan_Details.Remove(mstp);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
        // GET: CommPlanDetail/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            Mst_CommPlan_Detail user = db.Mst_CommPlan_Details.Include(m => m.Mst_CommPlan).Include(m => m.Mst_Role).Where(m => m.CommPlanDetailId == id).Single();

            if (user == null)
            {
                return(HttpNotFound());
            }
            return(View(user));
        }
Example #3
0
        // GET: CommPlanDetail/Edit/5
        public ActionResult Edit(int?id)
        {
            Mst_CommPlan_Detail mstcomplandtl = db.Mst_CommPlan_Details.Find(id);

            if (id == null)
            {
                return(HttpNotFound());
            }
            //string data = mstperform.ToString();
            //return View(mstperform);
            ViewBag.CommPlanid = new SelectList(db.Mst_CommPlans, "CommPlanid", "CommPlanDesc");
            ViewBag.RoleId     = new SelectList(db.Mst_Roles, "RoleId", "RoleName");
            string data = mstcomplandtl.ToString();

            return(View(mstcomplandtl));
        }
Example #4
0
 public ActionResult Create(Mst_CommPlan_Detail tambah)
 {
     try
     {
         //return Json(tambah,JsonRequestBehavior.AllowGet);
         // TODO: Add insert logic here
         //ViewBag.CommPlanid = new SelectList(db.Mst_CommPlans, "CommPlanid", "CommPlanDesc");
         //ViewBag.RoleId = new SelectList(db.Mst_Role, "RoleId", "RoleName");
         db.Mst_CommPlan_Details.Add(tambah);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Example #5
0
        public ActionResult Edit(int?id, Mst_CommPlan_Detail dEdit)
        {
            try
            {
                // TODO: Add update logic here
                if (id == null)
                {
                    return(HttpNotFound());
                }
                Mst_CommPlan_Detail mstcomplandtl = db.Mst_CommPlan_Details.Find(id);
                mstcomplandtl.CommPlanDetailId   = dEdit.CommPlanDetailId;
                mstcomplandtl.CommPlanid         = dEdit.CommPlanid;
                mstcomplandtl.Detail_Description = dEdit.Detail_Description;
                mstcomplandtl.RoleId             = dEdit.RoleId;
                db.SaveChanges();

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