public virtual async Task <IActionResult> Delete(DeleteCategoryModel model) { var serviceResult = await service.DeleteCategoryAsync(model.Id.Value); if (!serviceResult) { return(View(model)); } return(RedirectToAction(nameof(Index))); }
public ActionResult _Delete(int id, string No, string Title) { var model = new DeleteCategoryModel { Id = id, No = No, Title = Title }; return(View(model)); }
public Task <HttpResponseMessage> Delete(DeleteCategoryModel model) { HttpResponseMessage response = new HttpResponseMessage(); try { _service.Delete(model.Id); response = Request.CreateResponse(HttpStatusCode.OK, Msgs.SuccessfulyDelete); } catch (Exception ex) { response = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message); } var tsc = new TaskCompletionSource <HttpResponseMessage>(); tsc.SetResult(response); return(tsc.Task); }
public IActionResult DeleteMechanics(DeleteCategoryModel model) { _categoryService.DeleteMechanics(model.Id.Value); return(Ok()); }
public IActionResult DeleteDesigner(DeleteCategoryModel model) { _categoryService.DeleteDesigner(model.Id.Value); return(Ok()); }