Esempio n. 1
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var fixture = await _fixtureRepository.GetSingleFixture(id);

            _fixtureRepository.Delete(fixture);
            await _fixtureRepository.SaveChanges();

            return(RedirectToAction("Index", "Admin"));
        }
Esempio n. 2
0
        public JsonResult Delete(Fixture_VM Model)
        {
            if (CheckAccess(Model.CurrentScreenID, "Fixture"))
            {
                try
                {
                    GetUserInfo(Model);

                    if (Model.FixtureID > 0 && Model.FixtureID != null)
                    {
                        var data = _FixtureRepo.Delete(Model);
                        return(GetAddEditDeleteResponse(data, "Delete"));
                    }
                }
                catch (Exception ex)
                {
                    logger.Error("FixtureController_Delete Error: ", ex);
                    return(GetAddEditErrorException(ex));
                }
            }
            return(GetModelStateIsValidException(ViewData));
        }