コード例 #1
0
        public async Task <IHttpActionResult> Delete(string testId)
        {
            var result = await TestsDao.Delete(this, testId);

            if (result == null)
            {
                return(NotFound());
            }

            return(JsonWithPermissions(result));
        }
コード例 #2
0
        public async Task <ActionResult> ConfirmDelete(Test test)
        {
            if (test != null)
            {
                try
                {
                    await TestsDao.Delete(this, test);
                }
                catch (Exception)
                {
                    return(RedirectToAction("Delete", new { test = test.TestId, cannotDelete = true }));
                }
            }

            return(RedirectToAction("Index"));
        }