public async Task <ActionResult> DeleteConfirmed(int id)
        {
            var     request = new HTTPrequest();
            TourDto tour    = await request.Get <TourDto>("api/tour/" + id);

            tour.IsDeleted = true;
            await request.Delete("api/tour/" + id.ToString());

            return(RedirectToAction("Index", new { recentAction = "Deleted", recentName = tour.Name, recentId = tour.Id }));
        }
Beispiel #2
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            try {
                var          request   = new HTTPrequest();
                StoreItemDto storeItem = await request.Get <StoreItemDto>("api/storeItem/" + id);

                await request.Delete("api/storeItem/" + id);

                return(RedirectToAction("Index", new { recentAction = "Deleted", recentName = storeItem.Name, recentId = storeItem.Id }));
            }
            catch (Exception) {
                throw;
            }
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            try {
                var         request  = new HTTPrequest();
                ArtefactDto artefact = await request.Get <ArtefactDto>("api/artefact/" + id);

                await request.Delete("api/artefact/" + id);

                return(RedirectToAction("Index", new { recentAction = "Deleted", recentName = artefact.Name, recentId = artefact.Id }));
            }
            catch (Exception) {
                throw;
            }
        }
Beispiel #4
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            try
            {
                var       request = new HTTPrequest();
                BeaconDto beacon  = await request.Get <BeaconDto>("api/beacon/" + id);

                await request.Delete("api/beacon/" + id);

                return(RedirectToAction("Index", new { recentAction = "Deleted", recentName = beacon.Name, recentId = beacon.Id }));
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            try
            {
                var request = new HTTPrequest();
                StoreItemImageDto storeItemImage = await request.Get <StoreItemImageDto>("api/storeItemImage/" + id);

                storeItemImage.IsDeleted = true;
                await request.Put <StoreItemImageDto>("api/storeItemImage", storeItemImage);

                await request.Delete("api/storeItemImage/" + id.ToString());

                return(RedirectToAction("Index"));
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            try
            {
                var             request      = new HTTPrequest();
                ArtefactInfoDto artefactInfo = await request.Get <ArtefactInfoDto>("api/artefactInfo/" + id);

                artefactInfo.IsDeleted = true;
                await request.Put <ArtefactInfoDto>("api/artefactInfo", artefactInfo);

                await request.Delete("api/artefactInfo/" + id.ToString());

                return(RedirectToAction("Index"));
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            try
            {
                var             request      = new HTTPrequest();
                TourArtefactDto tourArtefact = await request.Get <TourArtefactDto>("api/tourArtefact/" + id);

                tourArtefact.IsDeleted = true;
                int tourId = tourArtefact.Tour.Id;
                //    await request.Put<TourArtefactDto>("api/tourArtefact", tourArtefact);

                await request.Delete("api/tourArtefact/" + id.ToString());

                return(RedirectToAction("Index", "ToursArtefacts", new { tId = tourId, recentAction = "Deleted", recentNameT = tourArtefact.Tour.Name, recentIdT = tourArtefact.Tour.Id, recentNameA = tourArtefact.Artefact.Name, recentIdA = tourArtefact.Artefact.Id }));
            }
            catch (Exception)
            {
                throw;
            }
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            var request = new HTTPrequest();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            ExhibitionDto exhibition = await request.Get <ExhibitionDto>("api/exhibition/" + id);

            if (exhibition == null)
            {
                return(HttpNotFound());
            }
            exhibition.IsDeleted = true;
            var requestDelete = new HTTPrequest();

            exhibition = await requestDelete.Put <ExhibitionDto>("api/exhibition", exhibition);

            await request.Delete("api/exhibition/" + id.ToString());

            return(RedirectToAction("Index", new { recentAction = "Deleted", recentName = exhibition.Name, recentId = exhibition.Id }));
        }