public ActionResult DestroyVideo([DataSourceRequest] DataSourceRequest request, UserVideoDto dto) { string error; if (dto == null) { return(Json(ModelState.ToDataSourceResult())); } if (dto.fileId != null && dto.fileId >= 0) { BaseAuthorServices.DeleteWaitingVideo((int)dto.fileId, out error); } else { if (dto.identifier != null) { BaseAuthorServices.DeleteVideo(long.Parse(dto.identifier), out error); } } return(Json(ModelState.ToDataSourceResult())); }
public JsonResult DeleteVideo(long id, int?fileId) { string error; var isDeleted = fileId != null?BaseAuthorServices.DeleteWaitingVideo((int)fileId, out error) : BaseAuthorServices.DeleteVideo(id, out error); return(Json(new JsonResponseToken { success = isDeleted , error = error }, JsonRequestBehavior.AllowGet)); }