public ActionResult HubOwnerDestroy([DataSourceRequest] DataSourceRequest request, HubUserViewModel userhub) { if (userhub != null && ModelState.IsValid) { var result = _userHubService.FindById(userhub.UserHubID); if (result != null) { _userHubService.DeleteUserHub(result); } } return(Json(ModelState.ToDataSourceResult())); }
public ActionResult DeleteConfirmed(int id) { UserHub userwarehouse = _userHubService.FindBy(u => u.UserHubID == id).Single(); _userHubService.DeleteUserHub(userwarehouse); return(RedirectToAction("Index")); }
// // POST: /UserWarehouse/Delete/5 public ActionResult Delete(int id) { try { UserHub userwarehouse = _userHubService.FindBy(u => u.UserHubID == id).Single(); _userHubService.DeleteUserHub(userwarehouse); return(RedirectToAction("Index")); } catch (Exception) { return(null); } }