public async Task <ActionResult> Delete(Guid id, CatalogDetailsViewModel request) { if (!ModelState.IsValid) { Alert("Bad Request", NotificationType.error, Int32.Parse(_appConfig.Value.NotificationDisplayTime)); return(View()); } if (id == null) { Alert($"Invalid Request", NotificationType.error, Int32.Parse(_appConfig.Value.NotificationDisplayTime)); return(View()); } try { var result = await _catalogService.Delete(id); if (!result.Success) { Alert($"Error! {result.Message}", NotificationType.info, Int32.Parse(_appConfig.Value.NotificationDisplayTime)); return(View()); } Alert($"Catalog Deleted Successfully", NotificationType.success, Int32.Parse(_appConfig.Value.NotificationDisplayTime)); return(RedirectToAction(nameof(Index))); } catch { Alert($"Error Occurred While processing the request", NotificationType.error, Int32.Parse(_appConfig.Value.NotificationDisplayTime)); return(View()); } }
public IHttpActionResult Delete(string id) { var catalog = _catalogService.GetById(id); CheckCurrentUserHasPermissionForObjects(CatalogPredefinedPermissions.Delete, catalog); _catalogService.Delete(new[] { id }); return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Delete(string id) { var catalog = _catalogService.GetByIds(new[] { id }); //TODO: //CheckCurrentUserHasPermissionForObjects(CatalogPredefinedPermissions.Delete, catalog); _catalogService.Delete(new[] { id }); return(Ok()); }
public IActionResult Delete(int id) { var item = _catalogService.GetById(id); if (item != null) { _catalogService.Delete(item); } return(RedirectToAction(nameof(Index))); }
public IActionResult DeleteCatalog(int catalogId) { var catalog = catalogId > 0 ? _catalogService.Get(catalogId) : null; if (catalog == null) { return(NotFound()); } _catalogService.Delete(catalog); return(R.Success.Result); }
void ICatalogService.Delete(string[] catalogIds) { _catalogService.Delete(catalogIds); ClearCache(); }
public IHttpActionResult Delete(int id) { _catalogService.Delete(id); return(Ok()); }
public ActionResult DeleteConfirmed(int id) { _service.Delete(id); return(RedirectToAction("Index")); }
public IHttpActionResult Delete(string id) { _catalogService.Delete(new string[] { id }); return(StatusCode(HttpStatusCode.NoContent)); }