Пример #1
0
        public ActionResult Delete(Guid id)
        {
            var apps = new Apps();
            var app = apps.GetApp(id);
            try
            {
                apps.DeleteApp(id);
                return RedirectToAction("Index", new { gid = app.GroupKey });
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("Error", ex.Message);

                var groups = new Groups();
                var group = groups.GetGroup(app.GroupKey);

                var model = new AppDetails()
                {
                    App = app,
                    Group = group,
                };

                return View("ConfirmDelete", model);
            }
        }