Example #1
0
        //Get: Description/Delete
        public ActionResult Delete(int id)
        {
            var service     = new DescriptionService();
            var description = service.GetDescription(id);

            return(View(description));
        }
Example #2
0
        //Get: Description/Edit/{id}
        public ActionResult Edit(int id)
        {
            var service = new DescriptionService();
            var detail  = service.GetDescription(id);
            var model   =
                new DescriptionEdit
            {
                DescriptionId   = detail.DescriptionId,
                DescriptionName = detail.DescriptionName,
            };

            return(View(model));
        }
Example #3
0
        public ActionResult DeletePost(int id)
        {
            var service = new DescriptionService();

            if (service.DeleteDescription(id))
            {
                TempData["SaveResult"] = "Description Deleted";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Description could not be updated");
            var model = service.GetDescription(id);

            return(View(model));
        }